add mongoquery code on server