monk vs mongoose for Mongodb

前端 未结 2 738
独厮守ぢ
独厮守ぢ 2021-01-31 06:53

I\'m learning NodeJs.

To connect to and use MongoDB from NodeJS, I see a lot of examples using either Monk or Mongoose.

Are these two libraries equivalent ? Do t

2条回答
  •  不知归路
    2021-01-31 07:58

    are they same thing do the same connection ? or do they have specific purpose ?

    They are different, although they are two approaches to the same basic problem. Mongoose is a quite sophisticated full-on ORM. More features, but more complexity. Monk is smaller in scope and thus easier to understand.

    My suggestion is start coding with the basic mongodb driver module directly. When you understand how that works, and how parts of it are annoying, you will understand the benefit of monk and can try that out to see if you like it. I wouldn't recommend mongoose to a beginner. Mongodb is already tricky enough to learn and while mongoose can be helpful, it's API is quite magical and assumes you already know the tricky aspects of mongodb.

提交回复
热议问题