-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
db.rel.find in Chrome Console fails with error #98
Comments
Eu preciso dessa mesma resposta... você conseguiu alguma coisa? |
@fernandacipriano também estou com este problema, mas levando em consideração que a pergunta deste rapaz, foi postada em 2018, acho que não teremos resposta! rs! |
Uma pessoa me ajudou a achar o problema... cfg.resolve.alias['pouchdb-promise'] = path.join(__dirname, '/node_modules/pouchdb-promise/lib/index.js'), Essa pessoa me explicou que é porque o relational ainda usa a promise do pouchdb, por isso ele se perde se não fizer essa configuração do alias na aplicação. Espero que posso ajudar mais alguém! Obrigada! |
This may not be the right forum for posting this question/issue...but after searching the relational-pouch GitHub website and reading all documentation, reviewing Issues, searching on stackOverflow and viewing multiple videos on pouchDB & document databases for possible answers/general information I'm not quite sure where to go at this point. I'm stuck. Hoping someone can steer me in the right direction.
I'm more than happy to share all the details of my code and config but before I did that I wanted to share the highlights of what I've done and the problem that I'm experiencing to see if anyone can help me in this forum.
Problem Summary:
I'm trying to use relational-pouch "plugin" for my webApp. I'd like to use the relational-pouch methods defined in the API from the Chrome Console so that I can become familiar with how to store and access data in the DB. This is critical for me.
The problem is none of the relational-pouch APIs that I've tested work from the console. I can successfully use these relational-pouch API's in my app (at least i've tested "db.rel.save()") but when I try and use the same exact command (copied from my code) in the console (but with a different id and user data) it fails with the following message "Uncaught TypeError: Cannot read property 'find' of undefined". BUT when I use other pouchDB commands in the console like "db.allDocs()" or db.info() they seem to work perfectly.
So why are the relational-pouch API's working fine in my app but not in the console?
Background:
I successfully included/installed pouchdb.js, pouchdb.find.js and pouchdb.relational-pouch.js in that order;
Added script tags in that order into my index.html file without error.
Successfully created a pouchDB via "var db = new PouchDB('taskIt');"
Used db.setSchema() to define my "schema" and used db.rel.save() method in my webapp to successfully load seed data into DB (verified through Chrome Dev tools ...was able to successfully see all all records I added. Note: My schema defines 4 "types" of data: user, taskList, taskItem and taskItemNotifications;
I was able to use "db.allDocs({include_docs: true})" from the Chrome Console to successfully retrieve all the records in the database.
However, when I try using the relational-pouchDB methods in Chrome console (e.g., db.rel.find(), db.rel.save()) I receive the following error message: "VM3152:1 Uncaught TypeError: Cannot read property 'find' of undefined ". (This message is for db.rel.find()...but I receive the same type of message with 'db.rel.save() method).
This would imply that db.rel is undefined? I'm puzzled because the "db.allDocs({include_docs: true})" command works just fine....so clearly db is defined. Maybe the .rel part of db.rel.find() method is undefined? Why?
BTW, when I downloaded relational-pouch (via the download button). I only added "pouchdb.relational-pouch.js" to my project. I didn't include any of the other items that came with the download (e.g., anything in the lib directory e.g., "pouch-utils.js" ) as the <script> tag specified in the installation directions only referenced the "pouchdb.relational-pouch.js" file.
Any thoughts on what might be wrong? Is there something else I need to do to use the relational-pouch commands from the Chrome Console?
Again I'd be happy to share additional details as needed....I just didn't want to include superfluous info at this point...especially if not necessary.
Also, if this is not the appropriate forum for asking questions can someone point me to where I can get answers to general questions that I might have re: the usage of the relational APIs? I feel like a video on how to use the relation API's to build an application is sorely needed. PouchDb has a basic video but there doesn't appear to be any similar video for relational-pouchdb. I think this is really needed to get widespread usage of this plugin.
Regards,
Jet
The text was updated successfully, but these errors were encountered: