Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any document storages on react native?

It would be great to have something similar to PouchDB.

Current key-value storage (AsyncStorage) is definitely not enough to store and query data.

like image 273
mrded Avatar asked Apr 04 '15 23:04

mrded


People also ask

Does React Native has LocalStorage?

To store value in local storage in React Native, we can use AsyncStorage. to call AsyncStorage. setItem with the key and value to storage the entry with the key and value. Then we call AsyncStorage.

What is the storage system in React Native?

AsyncStorage is a data storage system in React Native that is unencrypted, asynchronous, and allows users to persist data offline in React Native apps.

How do you use storage in React Native?

You can't use LocalStorage in React-Native, you can use AsyncStorage instead. Edit : You can also use a store like redux to handle this. Save data on Store on Redux is only temporal.


1 Answers

You may be able to use asyncstorage-down with PouchDB. Normally the method for using LevelDOWN adapters in Node.js is like so:

var PouchDB = require('pouchdb');
var db = new PouchDB('mydb', {db: require('asyncstorage-down')})

I haven't tested this, though.

Edit: well lucky you; a lot of work has been put into this recently: pouchdb-async-storage. Expect a blog post soon about how to get this working.

like image 140
nlawson Avatar answered Sep 29 '22 13:09

nlawson