Xbasic

mongo_deleteDocument Function

Syntax

P result = mongo_deleteDocument(C mongoURL_or_connectionString, C databaseName, C collection, C id)

Arguments

mongoURL_or_connectionStringCharacter

A Mongo AlphaDAO connection string or base URL.

databaseNameCharacter

The name of the MongoDB database.

collectionCharacter

The name of the collection.

idCharacter

The ID of the document to delete.

Returns

resultPointer

Returns an object with error (.t./.f.) and errorText properties.

Description

Deletes a specific document from a MongoDB collection.

Example

dim id as c = "60773000296c0832586538ba"
dim pr as p
pr = mongo_deleteDocument("::name::my_mongo_connstring", "myDatabase", "newCollection", id)

See Also