MongoDB的代码这是原来的代码我想:如何写在delphi
obj = {
sentence: "this is a sentece",
tags: [ "some", "indexing", "words"]
}
和
findOne({tags: "words"}).name);
我用TMongWire如MongoDB中的包装德尔福 和我写这个:
//var
// d:IBSONDocument;
d:=BSON([
'id',mongoObjectID,
'sentence', 'this is a sentece',
'tags','["some", "indexing", "words"]'
]);
FMongoWire.Insert(theCollection,d);
它似乎是c上述颂歌做的工作
但是当我用“标签”查询,它似乎不适合我
//var
//q:TMongoWireQuery;
//qb:IBSONDocument
qb:=BSON(['tags', '"words"']); //***
q:=TMongoWireQuery.Create(FMongoWire);
q.Query(mwx2Collection, qb); //***
我如何写两行*星号?
我会尝试通过本地德尔福'Array'类型。如果这不起作用,你总是可以在github上发布一个[TMongoWire问题](https://github.com/stijnsanders/TMongoWire/issues),并希望原作者将回应/记录需要什么。 – Stennie 2012-07-09 00:40:44
VarArrayOf()而不是BSONArray()....我离确定的答案并不遥远! :) OleVariant有点费时,并且依赖于平台......原生Delphi数组可能更有意义。 – 2012-07-09 06:20:41