Beamable SDK
Public Member Functions | Properties | List of all members
Beamable.Server.IStorageObjectConnectionProvider Interface Reference
Inheritance diagram for Beamable.Server.IStorageObjectConnectionProvider:
Inheritance graph
[legend]

Public Member Functions

Promise< IMongoDatabase > GetDatabase< TStorage > (bool useCache=true)
 Get a MongoDB connection for TStorage. More...
 
Promise< IMongoCollection< TCollection > > GetCollection< TStorage, TCollection > (string name)
 Gets a MongoDB collection by the requested name, and uses the given mapping class. If you don't want to pass in a name, consider using GetCollection<TStorage,TCollection>() More...
 
Promise< IMongoCollection< TCollection > > GetCollection< TStorage, TCollection > ()
 Gets a MongoDB collection for the mapping class given in TCollection. The collection will share the name of the mapping class. If you need to control the collection name separate from the mapping class name, consider using GetCollection<TStorage,TCollection>(string) More...
 

Properties

Promise< IMongoDatabase > this[string name] [get]
 Get a MongoDB connection by the storageName from StorageObjectAttribute that decorates a StorageObject class. This will never use the cached version. This method is deprecated. You should be using the GetDatabase<TStorage> method instead More...
 

Member Function Documentation

◆ GetCollection< TStorage, TCollection >() [1/2]

Promise< IMongoCollection< TCollection > > Beamable.Server.IStorageObjectConnectionProvider.GetCollection< TStorage, TCollection > ( )

Gets a MongoDB collection for the mapping class given in TCollection. The collection will share the name of the mapping class. If you need to control the collection name separate from the mapping class name, consider using GetCollection<TStorage,TCollection>(string)

Template Parameters
TStorageThe StorageObject type to get the collection from
TCollectionThe type of collection to fetch
Returns
When the promise completes, you'll have an authorized collection

Implemented in Beamable.Server.StorageObjectConnectionProvider.

Type Constraints
TStorage :MongoStorageObject 
TCollection :StorageDocument 

◆ GetCollection< TStorage, TCollection >() [2/2]

Promise< IMongoCollection< TCollection > > Beamable.Server.IStorageObjectConnectionProvider.GetCollection< TStorage, TCollection > ( string  name)

Gets a MongoDB collection by the requested name, and uses the given mapping class. If you don't want to pass in a name, consider using GetCollection<TStorage,TCollection>()

Parameters
nameThe name of the collection
Template Parameters
TStorageThe StorageObject type to get the collection from
TCollectionThe type of the mapping class
Returns
When the promise completes, you'll have an authorized collection

Implemented in Beamable.Server.StorageObjectConnectionProvider.

Type Constraints
TStorage :MongoStorageObject 
TCollection :StorageDocument 

◆ GetDatabase< TStorage >()

Promise< IMongoDatabase > Beamable.Server.IStorageObjectConnectionProvider.GetDatabase< TStorage > ( bool  useCache = true)

Get a MongoDB connection for TStorage.

You can save time by using the GetCollection<TStorage,TCollection>() or GetCollection<TStorage,TCollection>(string) methods.

Parameters
useCacheBy default, the database connection is cached. If you pass false here, the database connection will be forced to reconnect.
Template Parameters
TStorage
Returns

Implemented in Beamable.Server.StorageObjectConnectionProvider.

Type Constraints
TStorage :MongoStorageObject 

Property Documentation

◆ this[string name]

Promise<IMongoDatabase> Beamable.Server.IStorageObjectConnectionProvider.this[string name]
get

Get a MongoDB connection by the storageName from StorageObjectAttribute that decorates a StorageObject class. This will never use the cached version. This method is deprecated. You should be using the GetDatabase<TStorage> method instead

Parameters
name

The documentation for this interface was generated from the following file: