فهرست منبع

PR611 Fixed output for DB and QUERY

The results are not perfectly formatted, but they are good enough
for now.
Mike Smith 12 سال پیش
والد
کامیت
9532f50113
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      tornado/server.py

+ 2 - 2
tornado/server.py

@@ -41,14 +41,14 @@ class QueryTestHandler(BaseHandler):
 
         if queries == 0:
             random_id = random.randint(1, 10000)
-            world = yield motor.Op(db.world.find_one,{"id": random_id}, fields={"_id": 0, "id": 1, "randomNumber": 1})
+            world = yield motor.Op(db.World.find_one,{"_id": random_id}, fields={"_id": 1, "randomNumber": 1})
             # Get first postion on arguments, and so first postion in mongo return
             response = json.dumps(world)
         else:
             worlds = []
             for i in xrange(int(queries)):
                 random_id = random.randint(1, 10000)
-                world = yield motor.Op(db.world.find_one,{"id": random_id}, fields={"_id": 0, "id": 1, "randomNumber": 1})
+                world = yield motor.Op(db.World.find_one,{"_id": random_id}, fields={"_id": 1, "randomNumber": 1})
                 # Get first postion on arguments, and so first postion in mongo return
                 worlds.append(world)
             response = json.dumps(worlds)