I just hate typing db.foo.find({name: bear}) in mongo's CLI because pressing the shift key multiple times for brackets really slow me down. I like how I could just do select * from foo where name=bear. Able to type this kind of query fast and easy. Is there a tool where I can type sql queries and retrieves data from mongo? Don't like using their UI (mongo compass) because using the mouse slows me down even more TC 180 HCOL
Why don't you write a tool for it? Seems like a good project.
Good idea. I think I'll do that
You can use an abstraction layer over it like Spring Data Mongo if you are using Java or write your own SQL to mongo translator using Apache Calcite. Edit - someone already did that, there is a calcite-mongo library.
Thx, gonna check it out!
Even if you could save one second from typing that instead of moving the mouse and typing {name:bear}, it’s literally insignificant time savings
Might not seem a lot to you but it's a lot to me. 1s per query we talking about here
I know a few tools. They're people though not CLIs.
Use ddb
Simple, just use Postgres
This is true on a non - sarcastic level too. Most SQL databases these days have document storage built in, like postgres jsonb columns. Problem is usually one moves to nosql for the horizontal scaling aspects, so I'd say move to NewSql instead like Yugabyte or Cockroach db or TiDb, which scale horizontally yet offer atomic rdms style persistence. some of these are postgres wire compatible so you often do not even need to change your application's postgres drivers.
Jeez. No time for the shift key. Busy days.
Just make some aliases in your terminal. Super basic, super easy, and you can make them whatever you want. If you aren't familiar with making your own aliases for your development workflow, highly recommend reading up on it cuz I use it for nearly everything I do in the terminal, not just when working with mongdb
You talking about the alias you put in your bashrc or zshrc, like kubectl becomes kl, or mongodb becomes mdb? When the sql queries become a little more complex than select *, might become overwhelming
Yeah that's what I'm referring to. Definitely doesn't solve everything OP needs but should help a bit to reduce some of the repetitive stuff. I have a couple I use for basic finds or a simple aggregation when I am interacting with the same db over and over
Shoulda used a relational database bro.