Browse Source

corrected query

Waldecir Santos 12 years ago
parent
commit
c3e3a3e42c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tornado/server.py

+ 2 - 2
tornado/server.py

@@ -29,14 +29,14 @@ class QueryTestHandler(tornado.web.RequestHandler):
 
 
         if queries == 0:
         if queries == 0:
             random_id = random.randint(1, 10000)
             random_id = random.randint(1, 10000)
-            world = yield gen.Task(db.world.find_one,{"randomNumber": random_id}, fields={"_id": 0, "id": 1, "randomNumber": 1})
+            world = yield gen.Task(db.world.find_one,{"id": random_id}, fields={"_id": 0, "id": 1, "randomNumber": 1})
             # Get first postion on arguments, and so first postion in mongo return
             # Get first postion on arguments, and so first postion in mongo return
             world = world[0][0]
             world = world[0][0]
         else:
         else:
             worlds = []
             worlds = []
             for i in xrange(int(queries)):
             for i in xrange(int(queries)):
                 random_id = random.randint(1, 10000)
                 random_id = random.randint(1, 10000)
-                world = yield gen.Task(db.world.find_one,{"randomNumber": random_id}, fields={"_id": 0, "id": 1, "randomNumber": 1})
+                world = yield gen.Task(db.world.find_one,{"id": random_id}, fields={"_id": 0, "id": 1, "randomNumber": 1})
                 # Get first postion on arguments, and so first postion in mongo return
                 # Get first postion on arguments, and so first postion in mongo return
                 worlds.append(world[0][0])
                 worlds.append(world[0][0])