Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ / /

Class MongoNamespace

On this page

  • io.realm.mongodb.mongo
  • Constructors
  • Field Summary
  • Method Summary
  • Inherited Methods
  • Field Detail
  • COMMAND_COLLECTION_NAME
  • Constructor Detail
  • Method Detail
  • checkCollectionNameValidity
  • checkDatabaseNameValidity
  • equals
  • getCollectionName
  • getDatabaseName
  • getFullName
  • hashCode
  • toString
java.lang.Object
io.realm.mongodb.mongo.MongoNamespace

A MongoDB namespace, which includes a database name and collection name.

Constructor and Description

Construct an instance for the given full name.

String databaseName,
String collectionName
)

Construct an instance from the given database name and collection name.

Modifier and Type
Field and Description
public static final String
Modifier and Type
Method and Description
public static void

Check the validity of the given collection name.

public static void

Check the validity of the given database name.

public boolean
public String

Gets the collection name.

public String

Gets the database name.

public String

Gets the full name, which is the database name and the collection name, separated by a period.

public int
public String

Returns the standard MongoDB representation of a namespace, which is <database>.<collection> .

  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

String fullName
)

Construct an instance for the given full name. The database name is the string preceding the first "." character.

Parameters

  • fullName - the non-null full namespace

Tip

See also:

String databaseName,
String collectionName
)

Construct an instance from the given database name and collection name.

Parameters

  • databaseName - the valid database name

  • collectionName - the valid collection name

public static void checkCollectionNameValidity (
String collectionName
)

Check the validity of the given collection name. A valid collection name is non-null and non-empty. The server may impose additional restrictions on collection names.

Parameters

  • collectionName - the collection name

Throws

public static void checkDatabaseNameValidity (
String databaseName
)

Check the validity of the given database name. A valid database name is non-null, non-empty, and does not contain any of the following characters: '\0', '/', '\\', ' ', '"', '.' . The server may impose additional restrictions on database names.

Parameters

  • databaseName - the database name

Throws

public boolean equals (
)

Overrides

equals in class Object

Gets the collection name.

Returns

the collection name

Gets the database name.

Returns

the database name

Gets the full name, which is the database name and the collection name, separated by a period.

Returns

the full name

public int hashCode ()

Overrides

hashCode in class Object

public String toString ()

Returns the standard MongoDB representation of a namespace, which is <database>.<collection> .

Returns

string representation of the namespace.

Overrides

toString in class Object

Back

MongoDatabase