Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let PouchDB = require('pouchdb');
- PouchDB.plugin(require('pouchdb-load'));
- initDB() {
- this._db = new PouchDB('product4', { adapter: 'websql' });
- var myDumpedString = [{
- "name": "Product",
- "properties":
- {
- "id":
- {
- "type": "number",
- "description": "Product identifier",
- "required": true
- },
- "name":
- {
- "description": "Name of the product",
- "type": "string",
- "required": true
- },
- "price":
- {
- "type": "number",
- "minimum": 0,
- "required": true
- },
- "tags":
- {
- "type": "array",
- "items":
- {
- "type": "string"
- }
- }
- }
- }];
- console.log((JSON.stringify(myDumpedString)));
- this._db.load(myDumpedString).then(function () {
- console.log("Done loading!");
- }).catch(function (err) {
- console.log("error!");
- });
- window["PouchDB"] = PouchDB;
- }
- GET http://localhost:8100/[object%20Object] 404 (Not Found)
- error!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement