exclude feelds with find_one ? #1274
Unanswered
dandaniel5
asked this question in
Question
Replies: 1 comment
-
|
Tied like this: But it’s obviously wrong 🙂 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use find_one({ query }, { _id: 0, etc: 0 or 1 }).
Example of my object in DB:
class UserPublic(BaseModel):
tg_id: int
username: Optional[str] = None
I only need tg_id. I feel like it should be possible to use the native find_one(..., { "username": 0 }).
Beta Was this translation helpful? Give feedback.
All reactions