Version: Streamsheets 2.5
Replaces elements in a Mongo database. You can use the Function Wizard for this function. Only replaces one entry at a time.
=MONGO.REPLACE(Producer, Collection, Query, Document, Upsert)
|Producer||Producer to use for counting. The database name is configured in the affiliated Connector.|
|Collection||Choose an existing collection, where the item is stored.|
|Query||Define a query using a JSON cell range, which defines the document to be replaced.|
|Document||Defines the key-value pair(s) to be replacing the old entry.|
|Upsert||Optional Parameter to define, if a new document will be created when the query can not find a document to be replaced. Default = FALSE|
TRUE, if no error.
=MONGO.REPLACE(|Producer, "TestCollection", JSON(A1:B4), JSON(C1:D4))
|TRUE||The Query looks for a document in the collection which matches the A1:B4 key-value pairs. The found document will be deleted and the new document takes its place. If nothing is found to be replaced, no action will occur.|