Node.js + CouchDB vs CouchDB

后端 未结 5 1730
感情败类
感情败类 2021-02-04 10:20

I\'m questioning myself why should I use combination of Node.js + CouchDB versus CouchDB standalone approach. What are the benefits of getting Node.js into the game? Any comment

5条回答
  •  感情败类
    2021-02-04 10:39

    One of the benefits of using NodeJS in front of your CouchDB database is that you get more flexibility when implementing constraints.

    CouchDB only allows you to write validation functions in design documents that check the document that is being created/updated/deleted. It is not possible to access a other document that is stored in the database from within a design document.

    You might want this functionality if you need to check for the existence of document X before inserting Y.

提交回复
热议问题