From 7fd4f792ba30d1ac8061bdb017fe7703493ff0e0 Mon Sep 17 00:00:00 2001 From: Eddie Linder Date: Thu, 20 Dec 2018 01:02:42 +0200 Subject: [PATCH] Don't hide _cls field when using as_pymongo --- mongoengine/queryset/base.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mongoengine/queryset/base.py b/mongoengine/queryset/base.py index 5f11c01e..5493ffac 100644 --- a/mongoengine/queryset/base.py +++ b/mongoengine/queryset/base.py @@ -1837,10 +1837,6 @@ class BaseQuerySet(object): """Clean up a PyMongo doc, removing fields that were only fetched for the sake of MongoEngine's implementation, and return it. """ - # Always remove _cls as a MongoEngine's implementation detail. - if '_cls' in doc: - del doc['_cls'] - # If the _id was not included in a .only or was excluded in a .exclude, # remove it from the doc (we always fetch it so that we can properly # construct documents).