Hi.
I'm currently creating a new Ionic2 project in which, I've successfully implemented PouchDB. Everything was working until I haven't called destroy. Afterwards, I've ran this.db = new PouchDB(DB_NAME); and everything was working as it should.
But now, all of the sudden, I can't save document in my DB at all.
Here's my code (please keep in mind this is ng2/typescript project, meaning the code is... typescript :)):
this.storage.saveSingle({ _id: 'user', username: 'test', created: Date.now() });console.info('creating new doc', item); where item is our param. 
put: this.db.put(
{ item },
(err, res) => {
if (err) {
console.info('error creating new doc', err);
reject(err);
}
if (res) {
console.info('new doc created', res);
resolve(res);
}
}
);
CustomPouchError {status: 412, name: "missing_id", message: "_id is required for puts", error: true}missing_id resultTo tell you the truth... I'm clueless at the moment. What did I wrong?
Please, don't mind this ticket.
I was passing object within object for db.put parameter. -.-
this.db.put(
{ item },
should be
this.db.put(item,
I actually had the same typo, so thanks :+1: :)
Most helpful comment
I actually had the same typo, so thanks :+1: :)