Advertisement
Guest User

Untitled

a guest
May 28th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. let PouchDB = require('pouchdb');
  2. PouchDB.plugin(require('pouchdb-load'));
  3. initDB() {
  4. this._db = new PouchDB('product4', { adapter: 'websql' });
  5. var myDumpedString = [{
  6. "name": "Product",
  7. "properties":
  8. {
  9. "id":
  10. {
  11. "type": "number",
  12. "description": "Product identifier",
  13. "required": true
  14. },
  15. "name":
  16. {
  17. "description": "Name of the product",
  18. "type": "string",
  19. "required": true
  20. },
  21. "price":
  22. {
  23. "type": "number",
  24. "minimum": 0,
  25. "required": true
  26. },
  27. "tags":
  28. {
  29. "type": "array",
  30. "items":
  31. {
  32. "type": "string"
  33. }
  34. }
  35. }
  36. }];
  37. console.log((JSON.stringify(myDumpedString)));
  38. this._db.load(myDumpedString).then(function () {
  39. console.log("Done loading!");
  40. }).catch(function (err) {
  41. console.log("error!");
  42. });
  43.  
  44. window["PouchDB"] = PouchDB;
  45. }
  46.  
  47. GET http://localhost:8100/[object%20Object] 404 (Not Found)
  48. error!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement