Repository navigation
feat: [WIP] BSON Extended JSON and filter/sort query documents - #15
Draft
vinimcorrea wants to merge 2 commits into
Draft
vinimcorrea wants to merge 2 commits into
vinimcorrea wants to merge 2 commits into
Conversation
bson_to_json emitted ObjectId as hex, dates as epoch milliseconds and binary as the string "Binary(N bytes)". Send ObjectId, dates, UUIDs (binary subtype 4, as $uuid), other binary, decimals, timestamps and regular expressions as relaxed Extended JSON, and decode the same wrappers in json_to_bson so a tagged _id still locates its record. Date edits accept ISO 8601 text as well as epoch milliseconds.
A table tab's WHERE and ORDER BY were dropped: only the collection name
was read from the host's SELECT, so a filter silently showed unfiltered
data. WHERE and ORDER BY now carry query documents
(WHERE { status: 'active' } ORDER BY { _id: -1 }), read with the Mongo
shell syntax: unquoted keys, single quotes, ObjectId(), UUID(),
ISODate(), regex literals. Input that is not a query document is an
error with an example, not ignored. The same parser serves find() and
aggregate() arguments, and the host's row-count wrapper counts with the
filter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs TabularisDB/tabularis#1531. Host side: TabularisDB/tabularis#1766.
Draft / WIP, opened as agreed in TabularisDB/tabularis#1531.
Two changes the host's Documents view and Filter/Sort bar need from this plugin:
ObjectId, dates,Long,Decimal128, binary, ...) as MongoDB Extended JSON instead of flattening them to plain strings, so the host can show them as typed values. Values coming back from the host are read the same way, so edits keep the BSON type.json5: unquoted keys, single quotes, trailing commas) with Extended JSON values, and applies them to thefind.Validation
cargo test: 78 passed.Known limit
Missing fields vs. stored nulls is left for a follow-up, as agreed in TabularisDB/tabularis#1531.