PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Properties specific to the description of mongoFindOption variables
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
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 modified by several WLanguage properties.
Note: See Declaring a variable for more details.
Example
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 the description of mongoFindOption variables

The following properties can be used to handle the search options:
Property nameType usedEffect
SkipIntegerNumber of skipped documents. The first document returned will be the document corresponding to this value +1.
LimitIntegerMaximum number of documents that will be returned during the search.
ProjectionVariant, Buffer or Character stringDocument in JSON format (Character string), in BSON format (buffer) or variant defining the items to return.
SortVariant, Buffer or Character stringDocument 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".

Note: These properties can be handled by using one of the following syntaxes:
  • <Variable Name>..<Property Name>
  • <Variable Name>.<Property Name>
Related Examples:
Native access to MongoDB 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.
Minimum required version
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment