PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV, WEBDEV 25 feature!
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Modifies documents in a collection of a MongoDB database.
Example
MyCollection is mongoCollection
 
let sFilter = "{ ""name"": ""Andy"" }"
let sModification = "{ ""$inc"": { ""score"": 1 } }"
MyCollection.ModifyAll(sFilter, sModification)
gclCollection is mongoCollection
// Find all contacts whose "Name" member is set to "SMITH" and modifies them to "PAULSON"
 
// Search filter
sFilter is string = "{ ""Name"": ""SMITH"" }"
 
// Modification criterion
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 occurred. 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 corresponding to the filter used
Description of filters in MongoDB format that will be applied to select the documents to modify. This filter corresponds to:
  • a document in JSON format, in character string format.
  • a document in BSON format, in buffer format.
  • a variant.
<Modification>: Type corresponding to the format used
Description of the modifications that will be made in the documents corresponding to the filter. Corresponds to:
  • a document in JSON format, in character string format.
  • a document in BSON format, in buffer format.
  • a variant.
<Options>: Optional Integer constant
Modification options:
mongoAddIfNotFoundUsed to add the document if it does not exist in the collection.
mongoWithoutValidationThe document structure is not checked.
Component : wd250big.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment