pouchdb

One database per user security

感情迁移 提交于 2019-12-05 18:42:27
I develop an app with Ionic where each user got its own PouchDB database synchronise with its own remote CouchDB database. I use couch_peruser=true so any user that want to access its database need to authenticate. This system is easy to do if we store the username & password locally or if we ask the user to give them anytime a sync is needed but none of these options are good (security concern or non user-friendly). I came with those two options, but none is working: 1) The best option that came to me was to use Cookie Authentication , just save the token locally and use it, but unfortunately

PouchDB: filtering, ordering and paging

笑着哭i 提交于 2019-12-05 14:37:10
Very similar to these two CouchDB questions: 3311225 and 8924793 , except that these approaches don't allow partial matching . Having e.g. these entries: [{_id: 1, status: 'NEW', name: 'a'}, {_id: 2, status: 'NEW', name: 'aab'}, {_id: 3, status: 'NEW', name: 'ab'}, {_id: 4, status: 'NEW', name: 'aaa'}, {_id: 5, status: 'NEW', name: 'aa'}] and key [status, name, _id] There seems to be no way to filter these entries by status (full string match) and name (partial string match ~ startsWith ) order them by id paginate them because of the partial string match on name . The high value unicode

PouchDB + Superlogin + AngularJS 2

放肆的年华 提交于 2019-12-05 07:06:58
问题 I am currently trying to write a CouchApp based on AngularJS 2. The data should obviously get stored in a CouchDB. The web app should get the data out of the DB using PouchDB. For authentication I thought about using Superlogin. Unfortunately I cannot figure out how to use PouchDB within ng2 and employ Superlogin for authentication. Furthermore, I am not even sure if it is possible to do all that without having a node.js server. Any help/advice will be appreciated. Thank you. 回答1: I've just

Best practise of using localstorage to store a large amount of objects

南楼画角 提交于 2019-12-04 19:51:28
问题 Currently I'm experimenting with localStorage to store a large amount of objects of same type, and I am getting a bit confused. One way of thinking is to store all the object in an array. But then for each read/write of a single object I need to deserialise/serialise the whole array. The other way is to directly store each object with its key in the localStorage. This will make accessing each object much easier but I'm worried of the amount of objects that will be stored (tens of thousands).

PouchDB security

微笑、不失礼 提交于 2019-12-04 17:48:14
问题 What's the best security practice to follow while using PouchDB on the client-side to access a remote server? The example on https://pouchdb.com/getting-started.html syncs with the remote server with the code: var remoteCouch = 'http://user:pass@mname.example.com/todos'; The problem is I probably don't want the user to see the plaintext password with a file they can download -- even if that file is shown to the authenticated users only. Please advise. Thanks in advance, 回答1: Here's a really

CouchDB replication strategy with dynamic groups of users

不打扰是莪最后的温柔 提交于 2019-12-04 17:43:20
This is the situation: We have a series of users who share some documents. The documents they can share might change throughout the day, so can the documents themselves (changes and deletions). The users can change some information on the documents. E.g. Users | Documents A | X A | Y A | Z B | X B | Z C | Y Possible groups: A+C, A+B The server on CouchDB is a replica of a SQL Server DB with this data, an ETL takes care of managing changes on CouchDB. However, the CouchDB database is replicated on each user phone via PouchDB. The goal: To replicate changes and deletions accordingly. What we've

PouchDB - Manually managing conflicts

*爱你&永不变心* 提交于 2019-12-04 16:01:06
Is it possible to manage the sync conflicts from the client? What I mean is, when pouchDB does a sync and detects a conflict, is it possible to get the local doc PouchDB is trying to sync and the last revision of CouchDB doc? If I can get both docs, I can display them to the user and he can choose which version to keep... nlawson You're in luck, because this is exactly the problem CouchDB and PouchDB were designed to solve. Basically you can read up on the CouchDB docs on conflict resolution . Everything in there should also apply to PouchDB. (If it doesn't, it's a bug. ;)). The CouchDB wiki

Pouchdb document id complex key

让人想犯罪 __ 提交于 2019-12-04 15:58:49
I know views can be built using complex keys (an array basically). But, do normal documents also support that? I want to avoid views as performance on phones can be very slow with many many docs. So I'm using the "Use and abuse your keys" approach. So that is why I would need complex keys so I can use startkey and endkey on those. Yep, it's totally possible. Read this blog post , skip to "use and abuse your doc ids." Basically what you do is use the PouchDB Collate plugin to serialize your complex key into a string, and then use that for the _id . Then lookups work exactly the same as with the

Can PouchDB proxy a big database on the client side?

牧云@^-^@ 提交于 2019-12-04 14:27:19
问题 Working on single page applications i have to write a lot of boilerplate code in order to synchronise with the server side data. PouchDB offers an elegant solution to this problem allowing to access the data locally on the client side. What i don't understand, is whether Pouch is suitable as a database proxy or not, in cases when the database is too big to fully fit in the browser memory. As far as i can read, Pouch works duplicating a whole remote database, and thus can be used just in those

ionic framework sync data and work offline

此生再无相见时 提交于 2019-12-04 08:20:35
问题 I'm developing an app using ionic framework, and it will fetch some data from an API which was built using laravel, save it in a database so when the user is offline he can continue use the app, I did a little research on the internet and found a plugin called pouchDB, is it recommended for what I need? what is the best way to do it? 回答1: PouchDb is sure a good solution to provide data synchronization to your app. But depending from what you need to do you could choose between several PaaS