def __init__(self, collection, fields, truncate=False,
                 expand=False,
                 database=None, host='localhsot', port=27017,
                 store=None):
        super(MongoDBCollection, self).__init__()

        if store and database:
            raise ArgumentError("Both store and database spectified")

        if store:
            self.store = store
        else:
            self.store = _default_store(database, host, port)

        if isinstance(collection, str):
            self.collection = self.store.database[collection]
        else:
            self.collection = collection

        if expand is None:
            self.expand = store.expand
        else:
            self.expand = expand

        if not fields:
            raise NotImplementedError("MongoDB field detection is not yet "
                                      "implemented, please specify them "
                                      "manually")
        self.fields = fields

        if truncate:
            self.truncate()
Creates a MongoDB data object.
dataset/ETHPy150Open Stiivi/bubbles/bubbles/backends/mongo/objects.py/MongoDBCollection.__init__