PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Declaration
  • Properties specific to the description of mongoGridFS variables
  • Functions that use the mongoGridFS 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
mongoGridFS (Type of variable)
In french: mongoGridFS
The mongoGridFS type is used to define the advanced characteristics of a file system for a MongoDB database. The characteristics of this file system can be defined and modified by several 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("mongodb://db1.example.net")
fs is mongoGridFS
fs.Database = cntMDB.Database["CRM"]
fs.Prefix = "myfs"
Trace(MongoGridFSListFile(fs))
Declaration
MyVariable is mongoGridFS(<Database>, <Prefix>)
<Database>: Character string
MongoDB database containing the file system.
<Prefix>: Character string
Prefix of collection.
The files will be stored in the collections in the following format: <prefix>.files and <prefix>.chunck.
Remarks

Properties specific to the description of mongoGridFS variables

The following properties can be used to handle a MongoDB file system:
Property nameType usedEffect
DatabasemongoDatabase variableDatabase containing the file system.
PrefixCharacter stringPrefix of collection.
The files will be stored in the collections in the following format: <prefix>.files and <prefix>.chunck.

Functions that use the mongoGridFS type

The following functions use the mongoGridFS type:
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.
Remark: These functions can also be used to handle a Mongo database. In this case, the prefix corresponds to the default value "fs".
Prefix syntaxes are also available:
<mongoGridFS variable>.GetFileByIDRetrieves (on the local computer) a file identified by its identifier and found in a MongoDB file system.
<mongoGridFS variable>.GetFileRetrieves (on the local computer) a file identified by its name and found in a MongoDB file system.
<mongoGridFS variable>.GetFileInfoUsed to get information about a MongoDB file (gridFS).
<mongoGridFS variable>.DeleteFileByIDDeletes a file identified by its identifier from a MongoDB file system.
<mongoGridFS variable>.DeleteFileDeletes a file identified by its name from a MongoDB file system.
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