PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Returns information about a MongoDB database.
Example
infoMDB is MongoDatabaseInfo
infoMDB = MongoInfo(DatabaseMDB)
Trace("The database " + infoMDB..Name + " contains " + infoMDB..NbDocuments + " documents.")
// Read information about the current database
clInfo is mongoDatabaseInfo = MongoInfo(gclDatabase)

sInfo is string = StringBuild([
Information about the MongoDB database
--------------------------------
Database name: %1
Number of collections: %2
Number of documents: %3
Average size of documents: %4
Total database size: %5
Total storage size: %6
],
clInfo..Name,
clInfo..NbCollections,
clInfo..NbDocuments,
LengthToString(clInfo..AverageDocumentSize),
LengthToString(clInfo..DataSize),
LengthToString(clInfo..StorageSize))

Info(sInfo)
Syntax
<Result> = MongoInfo(<Database>)
<Result>: mongoDatabaseInfo variable
mongoDatabaseInfo variable containing information about the database.
<Database>: mongoDatabase variable
Name of mongoDatabase variable corresponding to the MongoDB database used.
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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230big.dll
Minimum required version
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment