ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / Big Data / Managing Mongo data files
  • Properties specific to mongoFindOption variables
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
mongoFindOption (Variable type)
In french: mongoChercheOption
The mongoFindOption type is used to define the advanced characteristics of a search in a MongoDB database. You can define and change the characteristics of this search using different WLanguage properties.
Note: 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)
Properties

Properties specific to 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: 03/27/2025

Send a report | Local help