Platforms to show: All Mac Windows Linux Cross-Platform
MongoCollectionMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | MongoDB | MBS MongoDB Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This handle is useful for actions for most CRUD operations, I.e. insert, update, delete, find, etc.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.
- 3 properties
- 19 methods
- method Aggregate(flags as Integer, pipelineJSON as String, OptionsJSON as String = "") as MongoCursorMBS
- method Command(commandJSON as String, OptionsJSON as String = "") as String
- method Constructor Private
- method Copy as MongoCollectionMBS
- method DeleteMany(selectorJSON as String, OptionsJSON as String = "") as String
- method DeleteOne(selectorJSON as String, OptionsJSON as String = "") as String
- method EstimatedDocumentCount(OptionsJSON as String = "") as Int64
- method EstimatedDocumentCount(OptionsJSON as String, byref ReplyJSON as String) as Int64
- method Find(FilterJSON as String, OptionsJSON as String = "") as MongoCursorMBS
- method FindIndexes(OptionsJSON as String = "") as MongoCursorMBS
- method InsertMany(documentArrayJSON as String, OptionsJSON as String = "") as String
- method InsertMany(documentJSON() as String, OptionsJSON as String = "") as String
- method InsertOne(documentJSON as String, OptionsJSON as String = "") as String
- method Keys as String()
- method Rename(NewDatabaseName as String, NewCollectionName as String, DropTargetBeforeRename as Boolean = false, OptionsJSON as String = "") as boolean
- method ReplaceOne(selectorJSON as String, replacementJSON as String, OptionsJSON as String = "") as String
- method UpdateMany(selectorJSON as String, updateJSON as String, OptionsJSON as String = "") as String
- method UpdateOne(selectorJSON as String, updateJSON as String, OptionsJSON as String = "") as String
- method Watch(pipelineJSON as String, OptionsJSON as String = "") as MongoChangeStreamMBS
- 7 constants
Flags
Constant | Value | Description |
---|---|---|
kFlagAwaitData | 32 |
Use with kFlagTailableCursor. Block rather than returning no data. After a period, time out. |
kFlagExhaust | 64 |
Stream the data down full blast in multiple “reply” packets. Faster when you are pulling down a lot of data and you know you want to retrieve it all. Only applies to cursors created from a find operation (i.e. find). |
kFlagNoCursorTimeout | 16 |
The server normally times out an idle cursor after an inactivity period (10 minutes). This prevents that. |
kFlagNone | 0 |
Specify no query flags. |
kFlagPartial | 128 |
Get partial results from mongos if some shards are down (instead of throwing an error). |
kFlagSecondaryOk | 4 |
Allow query of replica set secondaries. |
kFlagTailableCursor | 2 |
Cursor will not be closed when the last data is retrieved. You can resume this cursor later. |
This class has no sub classes.
Some methods using this class:
- MongoClientMBS.Collection(DatabaseName as String, CollectionName as String) as MongoCollectionMBS
- MongoDatabaseMBS.Collection(Name as String) as MongoCollectionMBS
- MongoDatabaseMBS.CreateCollection(Name as String, OptionsJSON as String = "") as MongoCollectionMBS
Some examples using this class:
Blog Entries
- Watch MongoDB Database changes in Xojo
- MBS Xojo Plugins, version 23.1pr2
- News from the MBS Xojo Plugins in Version 23.0
- News from the MBS Xojo Plugins Version 22.4
- Distinct in MongoDB to find all tags from documents
- MBS Xojo Plugins in version 22.4
- MBS Xojo Plugins, version 22.4pr1
- Insert record to MongoDB in Xojo
Xojo Developer Magazine
Release notes
- Version 23.1
- Added Command and Aggregate methods to MongoCollectionMBS class.
- Version 22.4
- Added InsertMany functions to MongoCollectionMBS class.
- Added Rename and FindIndexes functions to MongoCollectionMBS class.
The items on this page are in the following plugins: MBS MongoDB Plugin.
MongoClientMBS - MongoCursorMBS