发布于 2015-09-14 15:11:52 | 177 次阅读 | 评论: 0 | 来源: 网络整理

The documentation generally gives examples in JavaScript, use this chart to convert those examples to any language.

JavaScript Python PHP Ruby Java C++ C# Perl
[ ]
[]
array()
[]
BasicDBList
BSONObj

or

bson::bo
BsonArray
[ ]
{}
{}
new stdClass
{}
BasicDBObject
BSONObj
BsonDocument
{}
{ x : 1 }
{"x": 1}
array('x' => 1)
{'x' => 1}
BasicDBObjectBuilder.start().add("x", 1).get()
BSONObjBuilder().append("x", 1).obj();
BSON( "x" << 1 )
new BsonDocument("x", 1)
{ x : 1 }
connect("www.example.net")
Connection("www.example.net")
new Mongo("www.example.net")
Connection.new("www.example.net")
new Mongo("www.example.net", "dbname")
mongo::DBClientConnection conn;
conn.connect("www.example.net");
var server = MongoServer.Create("mongodb://www.example.net");
MongoDB::Connection->new(host => 'www.example.net')
cursor.next()
cursor.next()
$cursor->getNext()
cursor.next_document()
cursor.next()
cursor.next()
foreach (var document in cursor)
$cursor->next()
cursor.hasNext()
Does not exist
$cursor->hasNext()
cursor.has_next?
cursor.hasNext()
cursor.more()
 
$cursor->has_next()
collection.findOne()
collection.find_one()
$collection->findOne()
collection.find_one()
collection.findOne()
connection.findOne(namespace, query)
collection.FindOne()
$collection->find_one()
db.eval()
db.eval()
$db->execute()
db.eval()
db.doEval()
connection.eval()
db.Eval(js)
$db->eval()
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务