FireDAC.Phys.MongoDBWrapper.TMongoCollection.Remove

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

procedure Remove(ASelector: TMongoSelector; AFlags: TRemoveFlags = []); overload;
function Remove(AFlags: TRemoveFlags = []): TMongoSelector; overload;

C++

void __fastcall Remove(TMongoSelector* ASelector, TRemoveFlags AFlags = TRemoveFlags() )/* overload */;
TMongoSelector* __fastcall Remove(TRemoveFlags AFlags = TRemoveFlags() )/* overload */;

Properties

Type Visibility Source Unit Parent
procedure
function
public
FireDAC.Phys.MongoDBWrapper.pas
FireDAC.Phys.MongoDBWrapper.hpp
FireDAC.Phys.MongoDBWrapper TMongoCollection

Description

Removes the documents that match the specified selector from the collection.

Remove supports two different coding styles.

You can optionally specify a set of remove flags.

Example

The following example removes any restaurant named "La Bella Italia" from the collection.

MongDB shell:

db.restaurants.remove({ name: "La Bella Italia" })

Object Pascal:

MyCollection.Remove
  .Match
    .Add('name', 'La Bella Italia')
    .&End
  .Exec;

C++:

MyCollection->Remove()
  ->Match()
    ->Add("name", String("La Bella Italia"))
    ->End()
  ->Exec();

See Also