ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / Big Data / Managing Mongo files
  • Properties specific to mongoDatabase variables
  • Functions that use the mongoDatabase type
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
mongoDatabase (Type of variable)
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.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
cntMDB is mongoConnection
cntMDB = MongoCreate("mongodb://db1.example.net")
FOR EACH MyDatabase OF cntMDB.Database
Trace(MyDatabase.Name)
END
Remarks

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.

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: 06/22/2023

Send a report | Local help