GithubHelp home page GithubHelp logo

Comments (6)

meeximum avatar meeximum commented on July 4, 2024 4

ok it worked

let promises = new Array();
for (let customer of data.Customers) {
    promises.push(this._db.rel.save('customer', customer));
}

for (let holzart of data.Holzarten) {
    promises.push(this._db.rel.save('holzarten', holzart));
}
return Promise.all(promises);

from relational-pouch.

nolanlawson avatar nolanlawson commented on July 4, 2024

Yeah, I basically didn't support it because it didn't seem to be in the Ember Data API anywhere. But I'd be happy to add it if Ember Data comes up with a standard for it. :)

from relational-pouch.

meeximum avatar meeximum commented on July 4, 2024

Is there another way to check when PouchDB has saved all docs? I use a for loop to save my docs, and I want to react when all docs are really saved?

from relational-pouch.

broerse avatar broerse commented on July 4, 2024

@meeximum Don't know if this will help but in Paused state all docs are saved. See https://github.com/broerse/ember-cli-blog/blob/master/app/adapters/application.js#L45

It will even detect that your WiFi is down. See the red en green clouds in this example: https://bloggr.exmer.com/

from relational-pouch.

meeximum avatar meeximum commented on July 4, 2024

@broerse thx, but I don't use the replication mechanism, I just use PouchDB as local storage for an Ionic2 app.
I tried around with the Promise.all(), I thought I can add every db.rel.save() statement to an array and then make a Promise.all() call, but the db.rel.save() functions didn't get resolved :-(

from relational-pouch.

sahiliotasol avatar sahiliotasol commented on July 4, 2024

Thanks @meeximum You saved my day :)

from relational-pouch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.