org.mongodb.MongoQueryCursor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mongoFS Show documentation
Show all versions of mongoFS Show documentation
An extension to the MongoDB Java Driver library that goes beyond what the GridFS feature supports.
Compressed file storage, zip files, temporary files
package org.mongodb;
import org.mongodb.connection.ServerAddress;
import com.mongodb.DBCursor;
public class MongoQueryCursor implements MongoCursor {
private DBCursor surrogate;
public MongoQueryCursor(final DBCursor cursor) {
this.surrogate = cursor;
}
@SuppressWarnings("unchecked")
public T next() {
return (T) new Document(surrogate.next());
}
public boolean hasNext() {
return surrogate.hasNext();
}
@Override
public void close() {
surrogate.close();
}
@Override
public void remove() {
surrogate.remove();
}
@Override
public ServerAddress getServerAddress() {
return new ServerAddress(surrogate.getServerAddress().getHost(), surrogate.getServerAddress().getPort());
}
@Override
public ServerCursor getServerCursor() {
throw new UnsupportedOperationException();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy