You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/06/22 16:03:40 UTC

[GitHub] [couchdb-nano] muscaiu opened a new issue #168: replicating a firestore

muscaiu opened a new issue #168: replicating a firestore
URL: https://github.com/apache/couchdb-nano/issues/168
 
 
   Hello, i have decided to give up firebase and use a local db for my RPi project.
   So, because i can't use a decent MongoDB/Mongoose version because of the 32 architecture, i have decided to try CouchDB.
   
   The project is controling a simple on/off relay and storing the data to use for charts.
   So basically i need a couple of tables 'status' and 'mode' in which i will insert values like 
   
   for mode: 
   [{value: 'auto', createdAt: date()}, {value: 'manual', createdAt: date()} ...]
   
   for status
   [{value: true, createdAt: date()}, {value: false, createdAt: date()} ...]
   
   The problem is, i can't find a good way to structrue the data in a tabular form and yes i know this is a document based DB, but still it should be easy to find.
   I could use like 2 databases for each of my tables status and mode, but i don't think that's how i supposed to be doing it.
   
   This is what i have so far, but it's wrong.
   
   ```
   const nano = require('nano')('http://192.168.1.10:5984');
   const pompadb = nano.use('pompadb')
   
   router.post('/create', async (req, res) => {
     const mode = await pompadb.insert({
       value: 'manual',
       createdAt: Date.now()
     }, 'mode')
     return res.send(mode);
   });
   ```
   [
   ![firestore](https://user-images.githubusercontent.com/11426309/59965970-ffd12e80-951d-11e9-9e7b-3241d92a82e5.png)
   ](url)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services