if (uri.query() != null)
{
if (queryEngine == null)
throw new IOException("The query engine was not found");
MongoQuery mongoQuery = queryEngine.buildDBObjectQuery(uri);
DBCursor resultCursor = null;
if (mongoQuery.getProjection() == null)
resultCursor = collection.find(mongoQuery.getFilter());
else
resultCursor = collection.find(mongoQuery.getFilter(), mongoQuery.getProjection());
if (mongoQuery.getSkip() != null)
resultCursor.skip(mongoQuery.getSkip());
if (mongoQuery.getSort() != null)
resultCursor = resultCursor.sort(mongoQuery.getSort());
if (mongoQuery.getLimit() != null)
resultCursor = resultCursor.limit(mongoQuery.getLimit());
boolean createCursor = Boolean.TRUE.equals(options.get(Options.OPTION_QUERY_CURSOR));
if (createCursor)
{