how to write the mongodb code in delphi <p>This is the original code I tried:</p> <pre><code>obj = { sentence: "this is a sentece", tags: [ "some", "indexing", "words"] } </code></pre> <p>and </p> <pre><code>findOne({tags: "words"}).name); </code></pre> <p>I used the <strong>TMongWire</strong> as the wrapper of MongoDB for Delphi and I wrote this:</p> <pre><code>//var // d:IBSONDocument; d:=BSON([ 'id',mongoObjectID, 'sentence', 'this is a sentece', 'tags','["some", "indexing", "words"]' ]); FMongoWire.Insert(theCollection,d); </code></pre> <p>it seem the codes above do the work</p> <hr> <p>but when I query with the 'tags', it seems to not work for me</p> <pre><code>//var //q:TMongoWireQuery; //qb:IBSONDocument qb:=BSON(['tags', '"words"']); //*** q:=TMongoWireQuery.Create(FMongoWire); q.Query(mwx2Collection, qb); //*** </code></pre> <p>How do I write the two lines with <em>*</em> asterisks?</p>