Update queries to be compatible with mongoDB