|
|
|
|
- Properties specific to mongoFindOption variables
mongoFindOption (Type of variable) In french: mongoChercheOption
The mongoFindOption type is used to define the advanced characteristics of a search in a MongoDB database. The characteristics of this search can be defined and changed using different WLanguage properties. Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable. MyOptions is mongoFindOption MyOptions.Limit = 5 Â let MySearch = MongoFind(CntMdb.Database["CRM"].Collection["products"], "{}", MyOptions)
Option is mongoFindOption // Sort according to the age Option.Sort = "{ ""age"": -1 }" Â sFilter is string = "{}" let MyResult = MongoFind(CntMdb.Database["CRM"].Collection["Actors"], sFilter, Option) Remarks Properties specific to mongoFindOption variables The following properties can be used to handle the search options: | | | Property name | Type used | Effect |
---|
Limit | Integer | Maximum number of documents that will be returned during the search. | Projection | Variant, Buffer or Character string | Document in JSON format (Character string), in BSON format (buffer) or variant defining the items to return. | Skip | Integer | Number of skipped documents. The first document returned will be the document corresponding to this value +1. | Sort | Variant, Buffer or Character string | Document in JSON format (Character string), in BSON format (buffer) or variant defining the sort parameters. To get an ascending sort, the name of the key must be followed by ":1". To get a descending sort, the name of the key must be followed by ":-1". |
Related Examples:
|
Unit examples (WINDEV): Native access to MongoDB
[ + ] This example shows how to use the main functions of native access to MongoDB databases: adding data, reading (searching), modifying and deleting data in the database. The example also shows functions for saving files in the MongoDB GridFS data system.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|