我正在使用电机驱动程序连接到Mongo DB。 下面是插入数据的收集
电机返回无
client = motor.MotorClient('mongodb://localhost:27017').open_sync()
conn = client['database']['collection']
result = conn.insert({'foo': 'bar'})
print 'result:', result
insert语句总是返回无代码。 这不是一个龙卷风应用程序。 马达只能与龙卷风一起使用吗? 如果不是为什么插入没有返回?
我试过这个选项,但没有帮助。 – 2013-05-05 05:18:39
然后我猜,这不是在Motor drive客户端中指定WriteConcern的正确方法。 但是,您可以检查设置电机清理中的写入问题:http://motor.readthedocs.org/en/latest/api/motor_client.html#motor.MotorClient.write_concern – 2013-05-05 05:27:05