This is the original code I tried:
obj = { sentence: "this is a sentece", tags: [ "some", "indexing", "words"] }
and
findOne({tags: "words"}).name);
I used TMongWire as a MongoDB wrapper for Delphi and I wrote this:
//var // d:IBSONDocument; d:=BSON([ 'id',mongoObjectID, 'sentence', 'this is a sentece', 'tags','["some", "indexing", "words"]' ]); FMongoWire.Insert(theCollection,d);
it seems that the above codes do the job
but when I request "tags" it seems like this is not working for me
//var //q:TMongoWireQuery; //qb:IBSONDocument qb:=BSON(['tags', '"words"']); //*** q:=TMongoWireQuery.Create(FMongoWire); q.Query(mwx2Collection, qb); //***
How to write two lines with * asterisks?
source share