From f23b0faf4189a820827c4cc9efd75503b49a276a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20G=C3=A9rard?= Date: Tue, 23 Oct 2018 22:10:34 +0200 Subject: [PATCH] fix some asserts in no_dereference doc --- docs/guide/querying.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/querying.rst b/docs/guide/querying.rst index f1594dd2..08987835 100644 --- a/docs/guide/querying.rst +++ b/docs/guide/querying.rst @@ -456,14 +456,14 @@ data. To turn off dereferencing of the results of a query use :func:`~mongoengine.queryset.QuerySet.no_dereference` on the queryset like so:: post = Post.objects.no_dereference().first() - assert(isinstance(post.author, ObjectId)) + assert(isinstance(post.author, DBRef)) You can also turn off all dereferencing for a fixed period by using the :class:`~mongoengine.context_managers.no_dereference` context manager:: with no_dereference(Post) as Post: post = Post.objects.first() - assert(isinstance(post.author, ObjectId)) + assert(isinstance(post.author, DBRef)) # Outside the context manager dereferencing occurs. assert(isinstance(post.author, User))