Hello. Instead of writing SQL, would be very good to run something like: SELECT * FROM db_command('db.collection.aggregate(....)'); Thanks !