jeromelebel/MongoHub-Mac

[Feature Request] Export suggestion

anonrig opened this issue · 8 comments

I believe there isn't any specific export functionality for a specific query. Let's say my query is:

db.articles.find({'source.name': 'github'}).sort({ "_id": 1}).skip(0).limit(30)

I just want to export the results of this query to JSON. But if I press Export button, it exports the whole collection.

+1

select all documents, and do cmd-c

That doesn't work @jeromelebel

Which version do you use? What part doesn't work? Can you select all? Can you copy? What do you get when you paste?

In 3.0.8, I can select all documents but what is copied is: mongodb://localhost:27017/?
And yes it totally works in 3.1b.

Just a minor thing, is it possible to join documents with a comma? It'd make much easier to make valid JSON out of them. (I am a Obj-C noob, still looking where this process is going on.)

Ah, that's true, I've fixed this feature in 3.1b1

Join documents? You mean at the end of the line? (in the copy buffer)

At the end of every document actually. So it will be an array when pasted into [ ].

Right now the output is like:

{
  "id": 1,
  "key": "value1"
}
{
  "id": 2,
  "key": "value2"
}

what I'd prefer (and I think will be useful for everyone):

[
  {
    "id": 1,
    "key": "value1"
  },
  {
    "id": 2,
    "key": "value2"
  }
]

👍 thanks @jeromelebel