Advertisement
furas

Mongo - query

Jul 16th, 2018
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1.     [
  2.         { "$match":
  3.             {
  4.                 "$gt": { "timeStamp": self.starting_time },
  5.                 "$lt": { "timeStamp": self.finishing_time }
  6.             }
  7.         },
  8.         { "$out": destination_collection_name }
  9.     ]
  10.  
  11. # similar to
  12.    
  13.     [
  14.         { $match:
  15.             {
  16.                 date: "20120105"
  17.             }
  18.         },
  19.        
  20.         { $out: "subset" }
  21.     ]
  22.  
  23. # but you have
  24.  
  25.     {
  26.          "$match":
  27.             {
  28.                 "$gt": { "timeStamp": self.starting_time },
  29.                 "$lt": { "timeStamp": self.finishing_time }
  30.             },
  31.             { "$out": destination_collection_name }
  32.     }
  33.  
  34. # which is incorrect Python dictionary and incorrect JSON
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement