groundDB: how to add another database?


#1

I use groundDB:

tasks = new Ground.Collection(null)

I need add another database. I try add new database:

tasks = new Ground.Collection(null)
history = new Ground.Collection(null)

But i get error:

Uncaught Error: Storage.localStorage “null” is already in use

How correctly add new database?

If add name:

Details = new Ground.Collection("details collectoin on the server");
Details.insert({ "title": '111' })

And try:

Details.find({}).fetch()

in console empty array []

how to add another database?


#2

There’s no reason to use null since ground:db is always on the client anyway (and it needs a unique name since that determines where in localstorage ground:db will save it). I don’t know why your collection isn’t working though, maybe try without spaces in the name?


#3

Maybe you want to move your data to Mongo?. just wondering.


#4

I tried to make a short name for the database. What else can I try?


#5
        DBtasks.insert({
            "idPosition": Math.round(new Date().getTime() / 1000),
            "title": val,
            "complete": "",
            "star": false,
            "date": '' + new Date().getDay() + '.' + new Date().getMonth() + '.' + new Date().getFullYear(),
            "sessions": 0,
            "worked": 0,
            "rested": 0,
            "tags": [],
            "tagsIsFilter": "false",
            "note": ""
        })