MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / using

Method using

mongoengine/queryset/base.py:809–819  ·  view source on GitHub ↗

This method is for controlling which database the QuerySet will be evaluated against if you are using more than one database. :param alias: The database alias

(self, alias)

Source from the content-addressed store, hash-verified

807 return self
808
809 def using(self, alias):
810 """This method is for controlling which database the QuerySet will be
811 evaluated against if you are using more than one database.
812
813 :param alias: The database alias
814 """
815
816 with switch_db(self._document, alias) as cls:
817 collection = cls._get_collection()
818
819 return self._clone_into(self.__class__(self._document, collection))
820
821 def clone(self):
822 """Create a copy of the current queryset."""

Callers 1

test_usingMethod · 0.80

Calls 3

_clone_intoMethod · 0.95
switch_dbClass · 0.90
_get_collectionMethod · 0.80

Tested by 1

test_usingMethod · 0.64