PockDB/CouchDB/Cloudant PUT\u安全
数据库和云Cloudant设置 开发环境:离子混合应用程序(AngularJS) 要从代码创建数据库并设置权限 尝试PockDB/CouchDB/Cloudant PUT\u安全,couchdb,pouchdb,cloudant,Couchdb,Pouchdb,Cloudant,数据库和云Cloudant设置 开发环境:离子混合应用程序(AngularJS) 要从代码创建数据库并设置权限 尝试 put_安全性,但收到错误代码400。只有保留文档ID可以以下划线开头 有关修改权限的信息,请参阅Cloudant API。但未能实施。任何人都不知道如何执行此操作? 我的代码示例 var attendanceSecurity={ “\u id”:“\u安全”, “cloudant”:{ “无人”:[] } }; attendanceSecurity['cloudant'][u
var pouchOpts = {
skipSetup: false
};
var ajaxOpts = {
ajax: {
headers: {
Authorization: 'Basic ' + window.btoa(user2.name + ':' + user2.password)
}
}
};
var url = 'https://' + attendanceUsername + '.cloudant.com/' + user.id;
var db = new PouchDB(url, pouchOpts);
db.login(user2.name, user2.password, ajaxOpts).then(function() {
return db.allDocs();
}).then(function(docs) {
db.put(attendanceSecurity).then(function (response) {
// handle response
console.log(response);
}).catch(function (err) {
console.log(err);
});
console.log(docs);
}).catch(function(error) {
console.error(error);
});
这个图书馆值得一查。我很确定在代码库中有一些与你的问题相关的东西。这个图书馆值得一查。我很确定在代码库中有一些与你的问题相关的东西。