Closed toplinuxsir closed 6 years ago
Hey @toplinuxsir,
You can either specify the collection name:
class Foo(Thingy):
collection_name = "bar"
or the collection directly:
class Foo(Thingy):
collection = db.bar
You can then check what collection is being used with:
>>> Foo.collection
Collection(Database(MongoClient('localhost', 27017), 'database'), 'bar')
As you can notice, we really miss a proper documentation, and we're sorry for that. It's our main priority for the upcoming versions.
Feel free to open another issue if you have any other question @toplinuxsir. 👍
If the collection name dose not match the Thingy class name , How to specify the collection name of mongodb?