-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find documents of class and subclasses #1924
Comments
this might just be a transcription error, but presumably you want: class FooSubject(Subject): rather than: class FooSubject(subject): |
Have you taken a look at this post? #450 (comment) Another way would be to pass a raw query to MongoEngine. |
Yes, of course, thanks. I corrected my question. Thank you very much! |
|
The code I've posted shows that it works fine (on latest version). I'm able to retrieve FooSubject through Subject.objects(). In case you observe something different, please post a minimal reproducible code snippet that shows the issue. It could also be due to the existing data in your mongodb. I see that you are using DynamicDocument (instead of Document) so I guess you have some uncommon data in your collection. |
I realized. It works when I import in my |
Happy to help :). Please mark the ticket as "closed" in case the issue is resolved |
Please, help me.
when I write this:
it returns documents where
'_cls' == 'Subject'
only. And how I can get all documents from collectionsubjects
?P.S. Sorry for my English
The text was updated successfully, but these errors were encountered: