PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Properties specific to the description of 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 the description of 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.
MongoExecuteCommandRuns a generic command on a MongoDB database or on a MongoDB collection.
MongoGridFSSendFileCopies a file from the local computer to a MongoDB file system (gridFS).
MongoGridFSListFileRetrieves the list of MongoDB files found in the MongoDB file system (gridFS).
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).
MongoGridFSDeleteFileDeletes a file identified by its name from a MongoDB file system.
MongoGridFSDeleteFileByIDDeletes a file identified by its identifier from a MongoDB file system.
MongoInfoReturns information about a MongoDB database.
MongoDeleteDatabaseDeletes a MongoDB database as well as its collections.
Prefix syntaxes can also be used:
<mongoDatabase variable>.CreateCollectionCreates a collection in a MongoDB database while specifying the options of this collection.
<mongoDatabase variable>.ExecuteCommandRuns a generic command on a MongoDB database.
<mongoDatabase variable>.InfoReturns information about a MongoDB database.
<mongoDatabase variable>.DeteleDatabaseDeletes a MongoDB database as well as its collections.
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