ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / Big Data / Managing Mongo files
  • Declaration
  • Properties specific to 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.
Files will be stored in the collections as <prefix>.files and <prefix>.chunck.
Remarks

Properties specific to 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.
Files will be stored in the collections as <prefix>.files and <prefix>.chunck.

Functions that use the mongoGridFS type

The following functions use the mongoGridFS type:
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).
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>.DeleteFileDeletes a file identified by its name from a MongoDB file system.
<mongoGridFS variable>.DeleteFileByIDDeletes a file identified by its identifier from 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>.GetFileByIDRetrieves (on the local computer) a file identified by its identifier and found in a MongoDB file system.
<mongoGridFS variable>.GetFileInfoUsed to get information about a MongoDB file (gridFS).
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: 11/24/2023

Send a report | Local help