Skip to content

Borrow operators from Mongo? #22

Open

Description

@ethanresnick

Mongo's patch document format probably wouldn't make sense to copy/standardize directly, as it has some pretty big limitations (e.g., it's only possible to apply one operation to each document field) and it doesn't target values with JSON Pointer, so in that sense it doesn't compose well with existing standards.

That said, Mongo does have a pretty extensive set of update operators that have, presumably, proven themselves to be sufficient after/through pretty heavy developer use. (After all, I imagine Mongo's document patching format is by far the most widely-used JSON patch format.) Maybe these operators could offer a good starting point for JSON Patch 2?

Activity

  1. HappyNomad commented on Feb 22, 2018

    @HappyNomad

    I've built the front-end of a large mobile app that communicates user changes to the back-end via the JSON Patch derivative I described in #20. The back-end is coming along well, and next I must apply #20-style operations to data in Mongo. I plan to code a layer that translates those operations into Mongo's update format.

    While developing this mobile app, I've also created a .NET Standard 2.0 client-side library that tracks changes to domain objects and packages them into a #20-style document. I envision this library becoming a full-fledged synchronization framework for occasionally-connected mobile apps. I'd love to eventually make it open-source to promote the adoption of JSON Patch by document databases like Mongo.

    Now I must focus on translating the #20-style operations to Mongo updates. As with the client-side library, I hope to make this server-side translation code open-source, too. Is anyone interested in potentially using or helping further develop these? The client-side library is polished and done, but the server-side one is a work-in-progress. In particular, I could use help interpreting Mongo updates in terms of #20-style operations.

  2. mitar commented on Oct 12, 2019

    @mitar

    I would be against it. That should probably be a completely different standard. The beauty of JSON patch is that it is simple. MongoDB is complicated. There are also many special cases and edge cases which have to be handled differently. Also, the original query language was not enough and recently they had to add more queries to support like modifying arrays in multiple places at once and so on. So I would say that from my observation the language is far from complete and is changing all the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions