Correct way of using Mongoose in Deno - mongodb

In the previous project, I'm using NodeJS with Mongoose to handle schema and db connection, now that I'm trying to migrate to Deno, I found that Deno doesn't have Mongoose yet as its third party module.
I saw the reference, seems like they are using NPM to add mongoose (which means back to NodeJS way). The schema I found from deno_mongo is different from the schema I used in prev project.
And there is no example on how to use other collection id as reference to the current collection, for example:
userprofileid: {
type: mongoose.Types.ObjectId,
ref: "user_profiles"
},
so how to convert the code above?

Mongoose does not currently support Deno. See the answers in this feature request: https://github.com/Automattic/mongoose/issues/9056.
As described there, the problem is currently is that
Deno bugs out with the require_optional npm module, which is something that the MongoDB driver uses internally.
The second Problem:
Even without require_optional, Deno currently doesn't have a polyfill
for Node's crypto module: https://deno.land/std/node/README.md .
That's going to be hard for the MongoDB driver to work around.
look like it has been solved. Especially because there are already modules for MongoDB connection.
If you can do without the ODM from Mongoose, then you can use Deno Mongo (https://github.com/denodrivers/deno_mongo).
This connects you to the database and you can send your queries directly with Mongo database commands.
If you look at the third party modules on the Deno page and search for Mongo, you will unfortunately find that there is currently no ODM module for Mongo DB (https://deno.land/x?query=mongo)

There seems to be a similar ODM for Deno at https://dangodb.land/

Related

No a type declaration for the last mongo versions

I am developing a server side node based application transformed by TypeScript. I use mongo as the database. I use a npm library mongodb to work with the database. It does not contains declarations. There is a package #types/mongodb. I am confused that the upper version of mongo support is 3.1. Even docker hub does not have a container with such version. Could you suppose what I should do with? I see that TypeScript is not a good idea for server side. I've chosen it because Angular is used on the project.
Sorry. Everything works as it was designed. It was my personal mistake. I created an index for a collection without defining the collection.
await db.collection(this.collectionName).createIndex({'key': 1}, {unique: true});
But what I have written is still actual, It is the explicit definition. How does one file support all versions? I guess there still are some definition problem during downgrade. Thank you to everybody.

How to configure Mongodb with Laravel 5.4?

I tried to install "jenssegers/laravel-mongodb" from git
https://github.com/jenssegers/laravel-mongodb
and all the configuration has been done. but how can I know that my Laravel project successfully connected to MongoDB database?
Have you installed mongo? if not, here's a guide:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
if you want to try if it works, simply try to save something to the db using eloquent.
Just remember that in your model, extend "Jenssegers\Mongodb\Eloquent\Model" instead of "Illuminate\Database\Eloquent\Model"

How to integrate MongoDB in Django1.10 and Python3.5?

I would like to use mongoDB as a database on behalf SQL for my django project. Where in we are developing the apps with django1.10 and python-3.5 version. We installed MongoDB in ubuntu-16.02LTE and thought to use MongoEngine to work with python3.5 and Django-1.10. But we don't have proper document to integrate this in python and Django.
1) Did python 3.5 or django-1.10 support this procedure? if Yes please share document to refer
You answer to solve this more valuable for us
Thanks
Does this post help? It looks like MongoDB doesn't work with Django, and you will have to use mongoengine.

How to connect to Meteor's MongoDB instance using NetBeans?

I'm doing web development with Meteor, with runs MongoDB and minimongo as the default database.
NetBeans is the IDE I like, and am using for the HTML, CSS and JavaScript without a problem.
I'd like to be able to query the Meteor's MongoDB instance using NetBean's database GUIs as well; I don't know if any of NetBeans' standard DB views support MongoDB, but I have installed the NBMongo plugin, which adds a view for MongoDB, and have other integration troubles covered.
My problem is that I don't know how to connect to the Meteor's MongoDB (/minimongo) from the NetBeans plugin.
How do I do it?
Found the answer.
When you run meteor mongo on the shell/command-prompt, one of the things it will tell you is which address and port the Meteor's instance of the MongoDB is being run on. This is the key point I missed.
In most cases, as I was seeing in the references I found online, this will be 127.0.0.1:3001, or localhost:3001.
This wasn't the case for me, and that was why I was having trouble to setup my connection configuration.
I configured the NBMongo plugin's connection to mongodb://[correct address]:[correct port], and voilĂ ! Everything's working like a Swiss clock again!

MongoDB and Mongolab.com

Recently I discovered the power of noSQL database MongoDB. After a lot of trial and error I was able to install it on my pc along with wampserver. Its running smoothly. Now the question I would like to ask is, that if I want to integrate the MongoDB service provided by Mongolab on my shared hosting plan, is there any class available that helps me connect to the database? Like a php class version of the driver for php and mongodb. As it is not possible to install the driver on my hosting, because of no root access. So is there a raw class available as an alternative to the driver dll?
If you can't install the driver, then the REST interface provided by MongoLab is your best bet - any language that can send/receive a HTTP request can use REST:
http://support.mongolab.com/entries/20433053-rest-api-for-mongodb