본문 바로가기

Delphi/꿀팁

[mORMot] MongoDB의 Query Operator 사용하기

MongoDB접속 및 DB연결은 developist.tistory.com/2 참조


Use MongoDB Query Operator

var

Coll : TMongoCollection;

doc : Variant;

begin

doc := Coll.FindDoc('{Name:?}', [BSONVariant('{"Operator":"Value"}')]);

//Operator 추가

//ex) doc := Coll.FindDoc('{Name:?}', [BSONVariant('{"$regex":/teak/}')]);

//MongoDB Query Operator 참조

//https://docs.mongodb.com/manual/reference/operator/query/#query-selectors

ShowMessage(doc.Name);

end;


반응형