Comments (3)
Hey,
Thanks for the feedback.
We actually have that I think,
Model.query.first() will return first or None.
But Model.query().get() will get first or throw exceptions.
Does that make sense?
If you think it's not clear in the docs, we can improve that.
from mongox.
I didn't know 'first' does that, so we don't need to do that.
Thank you
from mongox.
No worries.
Although I think we could have other shodtcuts like get_or_create
or update_or_create
.
They can be useful. If you feel like they're usable feel free to do them.
from mongox.
Related Issues (17)
- EmbeddedModel
- Define ref field in the model
- Separating raw queries from query builder
- Setting default io_loop HOT 1
- Integration Tests
- Possible error in the return of the update method HOT 16
- Querying inside lists HOT 15
- Query builder for magic method `__contains__` HOT 1
- Data validation for `get_or_create` method
- maybe can provide Model.get() function for get obj by id? HOT 4
- Allow generator in `.all()` method
- Would be nice to have default connection and collection HOT 1
- Add `Q` method `regex` for matched strings HOT 2
- Bulk Inserts of Dictionary HOT 3
- Insert isn't working HOT 3
- Error when working with multiple models HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongox.