Install Elastic Search Server and mongoosastic search pagination

0

Download and install Elasticsearch server https://www.elastic.co/downloads/elasticsearch Download and unzip the latest Elasticsearch distribution Run bin/elasticsearch on Unix or sudo dpkg -i elasticsearch-xxx.deb Run curl -X GET http://localhost:9200/ Install and set “mongoosastic” nodejs module npm install –save mongoosastic server: blog.model.js: Locate Read more ›

[mongoosastic] Install Elastic Search Server and mongoosastic for Node.js

0

Install Elastic Search server Download and install https://www.elastic.co/downloads/elasticsearch Download and unzip the latest Elasticsearch distribution Run bin/elasticsearch on Unix or sudo dpkg -i elasticsearch-xxx.deb Run curl -X GET http://localhost:9200/ Install and set “mongoosastic” nodejs module npm install –save mongoosastic server: Read more ›

[mongoose] update and delete embedded document in array

0

Update: var comment = blog.comments.id(comment_id); comment.author = ‘Bruce Wayne’; blog.save(function (err) { // emmbeded comment with author updated }); Delete: Blog.findByIdAndUpdateAsync(blogId, { $pull: { comments: {_id: commentId}} }) .then(blog => { res.status(200).json(‘Comment is deleted successfully.’); }) .catch(err => { console.error(err); Read more ›

angular-fullstack generated code upgrade with Babel 6

0

Install  Babel 6 related packages: npm install –save-dev babel-register npm install –save-dev babel-plugin-add-module-exports npm uninstall –save-dev babel-core npm install –save-dev babel-core npm install babel-preset-es2015 Create .babelrc file: vi .babelrc { “presets”: [“es2015”], “plugins”: [“babel-plugin-add-module-exports”] } Chanage server/index.js file: vi server/index.js Read more ›