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)
| 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.""" |