MongoDB.GridFS.Drop
-------------------

Requests that an entire GridFS be dropped, including all files associated with it.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [MongoDB](component_MongoDB.md) | [16.3](newinversion163.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "MongoDB.GridFS.Drop"; MongoDBRef ) 

**MBS**( **"MongoDB.GridFS.Drop";** /\* Requests that an entire GridFS be dropped, including all files associated with it. \*/  
**$MongoDBRef**) /\* The reference number for the mongo connection.e.g. $MongoDB \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| MongoDBRef | The reference number for the mongo connection. | $MongoDB |

### Result

Returns OK or error.

### Description

Requests that an entire GridFS be dropped, including all files associated with it.  
### Examples

Drop GridFS:

 Perform Script \[ “Connect” ; Specified: From list ; Parameter: \]  
Set Variable \[ $Mongo ; Value: Get(ScriptResult) \]  
If \[ Length ( $Mongo ) = 0 // failed in connect script \]  
 Exit Script \[ Text Result: \]  
End If  
\#   
Set Variable \[ $r ; Value: MBS ( "[MongoDB.GridFS.Open](MongoDBGridFSOpen.md)"; $Mongo ; "test" ) \]  
If \[ MBS ("IsError") \]  
 Set Variable \[ $x ; Value: MBS ( "[MongoDB.Release](MongoDBRelease.md)"; $Mongo ) \]  
 Show Custom Dialog \[ "Failed to open gridfs." ; $r \]  
 Exit Script \[ Text Result: \]  
End If  
\#   
Set Variable \[ $r ; Value: MBS ( "MongoDB.GridFS.Drop"; $Mongo ) \]  
If \[ MBS ("IsError") \]  
 Set Variable \[ $x ; Value: MBS ( "[MongoDB.Release](MongoDBRelease.md)"; $Mongo ) \]  
 Show Custom Dialog \[ "Failed to drop gridfs." ; $r \]  
 Exit Script \[ Text Result: \]  
End If  
\#   
Show Custom Dialog \[ "Dropped gridfs" ; $r \]  
### See also

- [IsError](IsError.md)
- [MongoDB.GridFS.Close](MongoDBGridFSClose.md)
- [MongoDB.GridFS.Find](MongoDBGridFSFind.md)
- [MongoDB.GridFS.Open](MongoDBGridFSOpen.md)
- [MongoDB.GridFS.Read](MongoDBGridFSRead.md)
- [MongoDB.GridFS.Remove](MongoDBGridFSRemove.md)
- [MongoDB.GridFS.Write](MongoDBGridFSWrite.md)
- [MongoDB.Release](MongoDBRelease.md)

### Release notes

- **Version 16.3**
    - Added GridFS functions for MongoDB functions: MongoDB.GridFS.Close, MongoDB.GridFS.Drop, MongoDB.GridFS.Find, MongoDB.GridFS.FindOne, MongoDB.GridFS.FindOneByFileName, MongoDB.GridFS.GetChunks, MongoDB.GridFS.GetFiles, MongoDB.GridFS.Open, MongoDB.GridFS.Read, MongoDB.GridFS.Remove, MongoDB.GridFS.RemoveByFileName and MongoDB.GridFS.Write.

### Blog Entries

- [MongoDB GridFS in the MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2026-06-17/MongoDB_GridFS_in_the_MBS_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 16.3pr1](https://www.mbsplugins.de/archive/2026-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 28th May 2026 , last changed 28th May 2026

  
[MongoDB.GridFS.Close](MongoDBGridFSClose.md) - [MongoDB.GridFS.Find](MongoDBGridFSFind.md)

[HTML Version](MongoDBGridFSDrop.shtml)