Fixed mongodb adapter's query() function