Docs Menu

Class MongoNamespace

On this page

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

←  Class MongoDatabaseio.realm.mongodb.mongo.events →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.