Skip to content
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

Improve records view #5

Open
dashersw opened this issue Aug 15, 2020 · 2 comments
Open

Improve records view #5

dashersw opened this issue Aug 15, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@dashersw
Copy link
Owner

  1. This will probably require a custom records view.
  2. Just like in MongoHub, the records view should be a 3-column grid whereas the first column are keys, the second column are values, and the third column are types.
  3. Rows should alternate in background color.
  4. cmd+backspace key combination should delete the document
  5. cmd+c should copy the entire document JSON
  6. double click should open a modal to display the document in an editable format for easier/partial c/p.

image

@dashersw dashersw added the enhancement New feature or request label Aug 15, 2020
@emredalkiran
Copy link
Contributor

@dashersw I have a question regarding how to retrieve data types. From the screenshot you posted, I assume that we need BSON data types. mongoose does not provide a way of accessing underlying BSON data types. I also couldn't find a way to access these data types via the native driver. MongoDB has an extended JSON spec (https://github.com/mongodb/specifications/blob/master/source/extended-json.rst) but that seems to work more on the inserting or filtering part of queries, rather than evaluating a find query result. I've tried to use BSON parser (https://www.npmjs.com/package/bson#EJSON), which supports extended json deserialization but I couldn't get the underlying BSON types from that either.

@dashersw
Copy link
Owner Author

Oh I wasn't worried about BSON data types — but for each property we print, we should check whether they are boolean, string, number, Date, ObjectId, Array or Object. I found for object id's one can do record._id._bsontype and it returns ObjectID. For others, regular typeof checks (or Array.isArray and so on) should be enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants