-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add readConcern and collation support #105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is excellent work, thanks! We'll make sure to add this to mongoose as well.
@Fonger quick question: do you use mquery directly or do you go through mongoose? |
@vkarpov15 Thanks for the merge. #106 fix some documentation errors. I use both. I'm currently working on a project that use mquery as template in browser and convert it to pass all of the I would like to add eslint for this project to keep consistent coding style. Any idea on this? |
@Fonger +1 for the addition of eslint |
@Fonger thanks for eslint! That's an interesting approach. Mongoose has been slowly but surely moving away from using mquery internally because its proven to be a tangled abstraction and there are several features in Mongoose queries that aren't in mquery. But I've seen several projects popping up recently that use mquery so I'm thinking about whether we should focus on mquery more or focus on exporting something more like mquery from mongoose. I have a couple questions:
|
I prefer to support more query helpers in mquery and working on it. #108 - support write concern.
I use mongodb-extjson to preserve data types such as
I have another version using I'm not using
I'm not sure at this moment. In fact in my project i'm using mongoose for developer accounts only because I need custom validation. I have implemented a rule script language like Firebase to validate the operation and data. The actual mongodb operations are done by calling native mongodb driver.
I have never heard of MongoDB Stitch before. I google it and find it fantastic! |
I'm thinking about whether we should focus on mquery more or focus on
exporting something more like mquery from mongoose
mquery literally was exported from Mongoose. That is why it came to exist.
+1 to enhancing this.
…On Mon, Jul 30, 2018, 4:43 PM Fonger ***@***.***> wrote:
@vkarpov15 <https://github.com/vkarpov15>
I prefer to support more query helpers in mquery and working on it. #108
<#108> support write concern now
The best is to make the syntax compatible with mongo shell to avoid
confusion as the goals shown in README
What do you use to serialize mquery for HTTP?
I use mongodb-extjson <https://github.com/mongodb-js/mongodb-extjson> to
preserve data types such as ObjectId, Date, NumberLong, ...etc. Because
JSON only support string, number, boolean and plain
object.
I have another version using socket.io and transfer with binary. To
enhance the performance, in this websocket version, I serialize and encode
it via bson <https://github.com/mongodb/js-bson> which is compatible with
browser, sending with websocket binary data and then deserializing using
bson-ext <https://github.com/mongodb-js/bson-ext> because it uses native
C++ module in backend
If Mongoose's browser lib included a serializable query builder, would you
use that instead of mquery?
I don't know at this moment. In fact in my project i'm using mongoose for
developer accounts only because I need custom validation. The actually
mongodb operations are done by calling native mongodb driver.
If Mongoose's browser lib supported connecting to the browser and
executing queries via MongoDB Stitch, would you use that instead or would
you still prefer to send queries to a server for validation?
I have never heard of MongoDB Stitch before and I googled it and find it
fantastic!
I think I'm developing similar service like MongoDB Stich. When I finish
this project I'll open source it.
It's great to support MongoDB Stitch but I think it should be created in
another npm package because it is not really related to mongoose.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#105 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAKLsi13P3Y47H7-ccqY1poRM47A0sqAks5uL5o-gaJpZM4VlQqj>
.
|
Yeah, I meant winding mquery back into mongoose, because adding new functionality to both mongoose and mquery is cumbersome. Not actively pushing on that, just an idea to think about. |
readConcern
The readConcern options is not intuitive and have to be an object containing
level
property.If we just pass string to it, the native driver will throw error.
See Automattic/mongoose#6777 for the motivation
Before this pull request
After this pull request
maxTimeMS
Also, this pull request make maxTimeMS alias of maxTime.
So the syntax is now closer to mongo shell.
See Automattic/mongoose#6777 for the motivation
Before this pull request
After this pull request
collation
Add collation support
Before this pull request
After this pull request
mongoose
currently inheritmquery
and extendcollation
support.mongoose
may remove the implementation if using this version of mquery