Beamable SDK
Classes | Public Member Functions | Properties | List of all members
Beamable.Server.StorageObjectConnectionProvider Class Reference
Inheritance diagram for Beamable.Server.StorageObjectConnectionProvider:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Server.StorageObjectConnectionProvider:
Collaboration graph
[legend]

Classes

class  ConnectionString
 

Public Member Functions

 StorageObjectConnectionProvider (IRealmInfo realmInfo, IBeamableRequester requester)
 
async Promise< IMongoDatabase > GetDatabase< TStorage > (bool useCache=true)
 Get a MongoDB connection for TStorage. 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...
 
async Promise< IMongoCollection< TCollection > > GetCollection< TStorage, TCollection > (string collectionName)
 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...
 

Properties

Promise< IMongoDatabase > this[string name] [get]
 
- Properties inherited from Beamable.Server.IStorageObjectConnectionProvider
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.StorageObjectConnectionProvider.GetCollection< TStorage, TCollection > ( )
inline

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

Implements Beamable.Server.IStorageObjectConnectionProvider.

Type Constraints
TStorage :MongoStorageObject 
TCollection :StorageDocument 

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

async Promise< IMongoCollection< TCollection > > Beamable.Server.StorageObjectConnectionProvider.GetCollection< TStorage, TCollection > ( string  name)
inline

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

Implements Beamable.Server.IStorageObjectConnectionProvider.

Type Constraints
TStorage :MongoStorageObject 
TCollection :StorageDocument 

◆ GetDatabase< TStorage >()

async Promise< IMongoDatabase > Beamable.Server.StorageObjectConnectionProvider.GetDatabase< TStorage > ( bool  useCache = true)
inline

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

Implements Beamable.Server.IStorageObjectConnectionProvider.

Type Constraints
TStorage :MongoStorageObject 

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