ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / Big Data / Managing Mongo files
  • 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/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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 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.
Example
MesOptions is mongoFindOption
MesOptions.Limit = 5
 
let MaRecherche = MongoFind(CnxMdb.BaseDeDonnées["CRM"].Collection["produits"], "{}", MesOptions)
Option is mongoFindOption
// Tri selon l'âge
Option.Trie = "{ ""age"": -1 }"
 
sFiltre is string = "{}"
let MonRésultat = MongoFind(CnxMdb.BaseDeDonnées["CRM"].Collection["Acteurs"], sFiltre, Option)
Remarks

Properties specific to the description of mongoFindOption variables

The following properties can be used to handle the search options:
Property nameType usedEffect
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.
SkipIntegerNumber of skipped documents. The first document returned will be the document corresponding to this value +1.
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".
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 version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help