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 mongoDatabase variables
  • Functions that use the mongoDatabase type
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
mongoDatabase (Variable type)
In french: mongoBase
The mongoDatabase type is used to define the characteristics of a database for a MongoDB server. These characteristics can be defined and changed 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
cnxMDB is mongoConnection
cnxMDB = MongoCreate("mongodb://db1.exemple.net")
FOR EACH MaBase OF cnxMDB.Database
	Trace(MaBase.Nom)
END
Properties

Properties specific to mongoDatabase variables

The following properties can be used to handle a MongoDB database:
Property nameType usedEffect
CollectionArray of mongoCollectionAssociative array containing the collections of MongoDB database.
NameCharacter stringName of MongoDB database.
Remarks

Functions that use the mongoDatabase type

The following functions use mongoDatabase variables:
MongoCreateCollectionCreates a collection in a MongoDB database while specifying the options of this collection.
MongoDeleteDatabaseDeletes a MongoDB database as well as its collections.
MongoExecuteCommandRuns a generic command on a MongoDB database or on a MongoDB collection.
MongoGridFSDeleteFileDeletes a file identified by its name from a MongoDB file system.
MongoGridFSDeleteFileByIDDeletes a file identified by its identifier from a MongoDB file system.
MongoGridFSGetFileRetrieves (on the local computer) a file identified by its name and found in a MongoDB file system.
MongoGridFSGetFileByIDRetrieves (on the local computer) a file identified by its identifier and found in a MongoDB file system.
MongoGridFSGetFileInfoAllows you to get information about a MongoDB file (gridFS).
MongoGridFSListFileRetrieves the list of MongoDB files found in the MongoDB file system (gridFS).
MongoGridFSSendFileCopies a file from the local computer to a MongoDB file system (gridFS).
MongoInfoReturns information about a MongoDB database.
Prefix syntaxes can also be used:
<mongoDatabase variable>.CreateCollectionCreates a collection in a MongoDB database while specifying the options of this collection.
<mongoDatabase variable>.DeteleDatabaseDeletes a MongoDB database as well as its collections.
<mongoDatabase variable>.ExecuteCommandRuns a generic command on a MongoDB database.
<mongoDatabase variable>.InfoReturns information about a MongoDB database.
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