0

We can accept 20 times slower to avoid using python or C++ in our project. Are there a native module that still works?

0

2 Answers 2

2

There is no need to invent wheel. mongodb package is the simplest one

But if You insist there are many ways:

Easy way: You can use Rest API of mongo and do requests to it using request package

Moderate way: Open mongodb-core package and copy out what You need most, make Your own mongodb class.

Moderate way #2: fork mongodb package, manipulate it and save with new repository name

Hard way: If You want go hardcore (: read mongodb protocol and operate with it using net package to open socket connection to mongodb server.

Sign up to request clarification or add additional context in comments.

5 Comments

So there isn't anyone already reinvented the wheels? Ah... T_T
I'm also inventing sometimes, but after a while I understand that it's time waste. If there is working packages, why I need to waste my time to making new one? You can do following: fork mongodb package, manipulate it and save with new name.
Personally if I'm working with MongoDB I prefer to use the Mongoose ORM. It just works and I love the way they have you method chain queries. Reminds me of using LINQ to Entities in C#.
@Chev I'm also using mongoose in my projects. But in case of low level code I recommend SCLeo to have a look to native packages.
@Chev Thanks for mentioning Mongoose. I am going to use that. :)
1

How about Crest? It's a node wrapper around the MongoDB server that provides a REST API. With it you could talk to MongoDB over REST instead of with a native client, similar to CouchDB.

There are some other utilities listed here. Maybe you're okay with using Python outside of your app but in front of MongoDB to provide the REST API? If so then maybe those are some alternatives if you don't like Crest. Haven't used it myself so I can't vouch for its quality, but it is listed on MongoDB's own list so hopefully it's decent.

6 Comments

Thanks, but this does not have a detailed document. At least I cannot find. Thanks anyways.
Np. If you're not willing to wrap the MongoDB server with something to provide an API easier to consume in native node then I think your only bet is to literally talk to the MongoDB server with your own socket. @num8er's answer mentions the same thing. That's gonna be a lot of work though.
Another alternative is to switch to CouchDB ;)
Never heard of CouchBase. Is it related to CouchDB?
@Chev :) ohh... my mistake. But I like CouchBase after MongoDB.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.