Commit 219a95db authored by Sachinda 's avatar Sachinda Committed by Stephan Handuwala

Master

parent d3c9afc8
File added
CouchDB databse management
sample configuration file 'config.js'
\ No newline at end of file
module.exports = [{
"user_name": "prodsupp_root",
"password": "3a2riAMMA0b39ejBrKzHYr1Og8xOt9g8",
"service_url": "vg_prodsupp_couchdb",
"service_port": 5984,
"db_name": "hellow"
},
{
"user_name": "prodsupp_root",
"password": "3a2riAMMA0b39ejBrKzHYr1Og8xOt9g8",
"service_url": "vg_prodsupp_couchdb",
"service_port": 5984,
"db_name": "_users"
},
{
"user_name": "prodsupp_root",
"password": "3a2riAMMA0b39ejBrKzHYr1Og8xOt9g8",
"service_url": "vg_prodsupp_couchdb",
"service_port": 5984,
"db_name": "hello",
"view_document": {
"_id": "_design/viewModel_views",
"views": {
"activeStatusCount": {
"map": "function (doc) {\n if(typeof(doc.active_status) === 'boolean'){\n emit([doc.active_status], 1)\n }\n}",
"reduce": "_count"
}
},
"updates": {
"add_update": "function(doc, req){ var reqb = JSON.parse(req.body); if (!doc){ return[ reqb, 'NEW DOC']; } else { reqb['_rev'] = doc['_rev']; return [reqb, 'UPDATE DOC'] }}"
},
"language": "javascript"
},
"index_document": {
"_id": "_design/indexes",
"language": "query",
"views": {
"position": {
"map": {
"fields": {
"position": "desc "
},
"partial_filter_selector": {}
},
"reduce": "_count",
"options": {
"def": {
"fields": ["position"]
}
}
}
}
},
"update_handler": {
"_id": "_design/handler",
"updates": {
"handler": "function(doc, req){ var reqb = JSON.parse(req.body); if (!doc){ var newDoc = { _id:req.uuid, type: reqb.type, origin_id: reqb.origin_id, locale: reqb.locale, values_translation: reqb.values_translation}; return[ newDoc, 'NEW DOC']; } else { return [reqb, 'UPDATE DOC'] } }"
},
"language": "javascript"
}
}
]
\ No newline at end of file
node_modules/*
This diff is collapsed.
const Schema = require("validate");
const model = new Schema({
user_name: {
type: String,
required: true,
},
password: {
type: String,
required: true,
},
service_url: {
type: String,
required: true,
},
service_port: {
type: Number,
required: true
},
db_name: {
type: String,
required: true,
},
});
module.exports = model;
\ No newline at end of file
This diff is collapsed.
{
"name": "couch_db_create",
"version": "1.0.0",
"description": "ls -l",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+ssh://git@gitlab.com/sachinda/npm_db_create.git"
},
"author": "Parywaylabs",
"license": "ISC",
"bugs": {
"url": "https://gitlab.com/sachinda/npm_db_create/issues"
},
"homepage": "https://gitlab.com/sachinda/npm_db_create#readme",
"dependencies": {
"nano": "^8.2.2",
"object-hash": "^2.0.3",
"validate": "^5.1.0"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment