|
|
|
|
<mongoCollection variable>.ModifyAll (Function) In french: <Variable mongoCollection>.ModifieTout Modifies documents in a collection of a MongoDB database. MyCollection is mongoCollection
let sFilter = "{ ""name"": ""Andy"" }"
let sModification = "{ ""$inc"": { ""score"": 1 } }"
MyCollection.ModifyAll(sFilter, sModification) gclCollection is mongoCollection
sFilter is string = "{ ""Name"": ""SMITH"" }"
sModification is string = "{ ""$set"": {""Name"": ""PAULSON"" } }"
gclCollection.ModifyAll(sFilter, sModification) Syntax
<Result> = <Collection>.ModifyAll(<Filter> , <Modification> [, <Options>])
<Result>: Boolean - True if the operation was performed,
- False if a problem occurs. ErrorInfo is used to identify the error.
<Collection>: mongoCollection variable Name of the mongoCollection variable that represents the MongoDB collection in which the modification must be made. <Filter>: Type of the filter used Description of the MongoDB filter(s) that will be applied to select the documents to modify. This filter corresponds to: - a JSON document, in string format.
- a BSON document, in buffer format.
- a variant.
<Modification>: Type of the format used Description of the modifications that will be made in the documents corresponding to the filter. Corresponds to: - a JSON document, in string format.
- a BSON document, in buffer format.
- a variant.
<Options>: Optional Integer constant Modification options: | | mongoAddIfNotFound | Used to add the document if it does not exist in the collection. | mongoWithoutValidation | The document structure is not checked. |
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|