Package | Description |
---|---|
com.mongodb |
This package is the main entry point to the MongoDB Java Driver, and it contains the classes for the existing API from 2.x versions.
|
com.mongodb.async.client |
This packages contains classes for the new async client
|
com.mongodb.client |
This package contains client interfaces
|
com.mongodb.client.gridfs.model |
This package contains models for use with GridFS
|
org.bson |
This package contains bson classes required for the driver
|
org.bson.codecs |
This package contains all the default BSON codecs.
|
org.bson.types |
This package contains driver specific type classes
|
Modifier and Type | Method and Description |
---|---|
ListDatabasesIterable<Document> |
MongoClient.listDatabases()
Gets the list of databases
|
Modifier and Type | Method and Description |
---|---|
MongoCollection<Document> |
MongoDatabase.getCollection(String collectionName)
Gets a collection.
|
ListCollectionsIterable<Document> |
MongoDatabase.listCollections()
Finds all the collections in this database.
|
ListDatabasesIterable<Document> |
MongoClient.listDatabases()
Gets the list of databases
|
ListIndexesIterable<Document> |
MongoCollection.listIndexes()
Get all the indexes in this collection.
|
Modifier and Type | Method and Description |
---|---|
void |
MongoDatabase.runCommand(Bson command,
ReadPreference readPreference,
SingleResultCallback<Document> callback)
Executes the given command in the context of the current database with the given read preference.
|
void |
MongoDatabase.runCommand(Bson command,
SingleResultCallback<Document> callback)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
Modifier and Type | Method and Description |
---|---|
Document |
MongoDatabase.runCommand(Bson command)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
Document |
MongoDatabase.runCommand(Bson command,
ReadPreference readPreference)
Executes the given command in the context of the current database with the given read preference.
|
Modifier and Type | Method and Description |
---|---|
MongoCollection<Document> |
MongoDatabase.getCollection(String collectionName)
Gets a collection.
|
ListCollectionsIterable<Document> |
MongoDatabase.listCollections()
Finds all the collections in this database.
|
ListIndexesIterable<Document> |
MongoCollection.listIndexes()
Get all the indexes in this collection.
|
Modifier and Type | Method and Description |
---|---|
Document |
GridFSFile.getExtraElements()
Deprecated.
any extra information should be stored in the metadata document.
|
Document |
GridFSUploadOptions.getMetadata()
Returns any user provided data for the 'metadata' field of the files collection document.
|
Document |
GridFSFile.getMetadata()
Any additional metadata stored along with the file
|
Modifier and Type | Method and Description |
---|---|
GridFSUploadOptions |
GridFSUploadOptions.metadata(Document metadata)
Sets metadata to stored alongside the filename in the files collection
|
Constructor and Description |
---|
GridFSFile(BsonValue id,
String filename,
long length,
int chunkSize,
Date uploadDate,
String md5,
Document metadata)
Creates a new GridFSFile
|
GridFSFile(BsonValue id,
String filename,
long length,
int chunkSize,
Date uploadDate,
String md5,
Document metadata,
Document extraElements)
Creates a legacy implementation of the GridFSFile
|
Modifier and Type | Method and Description |
---|---|
Document |
Document.append(String key,
Object value)
Put the given key/value pair into this Document and return this.
|
static Document |
Document.parse(String json)
Parses a string in MongoDB Extended JSON format to a
Document |
static Document |
Document.parse(String json,
Decoder<Document> decoder)
Parses a string in MongoDB Extended JSON format to a
Document |
Modifier and Type | Method and Description |
---|---|
static Document |
Document.parse(String json,
Decoder<Document> decoder)
Parses a string in MongoDB Extended JSON format to a
Document |
String |
Document.toJson(Encoder<Document> encoder)
Gets a JSON representation of this document
|
String |
Document.toJson(JsonWriterSettings writerSettings,
Encoder<Document> encoder)
Gets a JSON representation of this document
|
Modifier and Type | Method and Description |
---|---|
Document |
DocumentCodec.decode(BsonReader reader,
DecoderContext decoderContext) |
Document |
DocumentCodec.generateIdIfAbsentFromDocument(Document document) |
Modifier and Type | Method and Description |
---|---|
Class<Document> |
DocumentCodec.getEncoderClass() |
Modifier and Type | Method and Description |
---|---|
boolean |
DocumentCodec.documentHasId(Document document) |
void |
DocumentCodec.encode(BsonWriter writer,
Document document,
EncoderContext encoderContext) |
Document |
DocumentCodec.generateIdIfAbsentFromDocument(Document document) |
BsonValue |
DocumentCodec.getDocumentId(Document document) |
Constructor and Description |
---|
CodeWithScopeCodec(Codec<Document> documentCodec)
Creates a new CodeWithScopeCodec.
|
Modifier and Type | Method and Description |
---|---|
Document |
CodeWithScope.getScope()
Gets the scope, which is is a mapping from identifiers to values, representing the scope in which the code should be evaluated.
|
Constructor and Description |
---|
CodeWithScope(String code,
Document scope)
Construct an instance.
|
Copyright © 2016. All Rights Reserved.