def neighbors(): query = {} for key in request.args: query[key] = request.args.getlist(key) data = Model.find_neighbors(query, include_original=True) return (dumps(data), 200, {'Content-Type': 'application/json'})
def get(self): query = {} for key in request.args: if key == '_id': query[key] = {"$in" : [ObjectId(id) for id in request.args.getlist(key)]} else: query[key] = {"$in" : request.args.getlist(key)} data = Model.find_neighbors(query, include_original=True) return data
def neighbors(): query = {} for key in request.args: if key == '_id': query[key] = {"$in" : [ObjectId(id) for id in request.args.getlist(key)]} else: query[key] = {"$in" : request.args.getlist(key)} data = Model.find_neighbors(query, include_original=True) return (dumps(data), 200, {'Content-Type': 'application/json'})
def get(self): query = {} for key in request.args: if key == '_id': query[key] = { "$in": [ObjectId(id) for id in request.args.getlist(key)] } else: query[key] = {"$in": request.args.getlist(key)} data = Model.find_neighbors(query, include_original=True) return data
def neighbors(): query = {} for key in request.args: if key == '_id': query[key] = { "$in": [ObjectId(id) for id in request.args.getlist(key)] } else: query[key] = {"$in": request.args.getlist(key)} data = Model.find_neighbors(query, include_original=True) return (dumps(data), 200, {'Content-Type': 'application/json'})