masumsoft / express-cassandra

Cassandra ORM/ODM/OGM for NodeJS with support for Apache Cassandra, ScyllaDB, Datastax Enterprise, Elassandra & JanusGraph.
http://express-cassandra.readthedocs.io
GNU Lesser General Public License v3.0
227 stars 67 forks source link

Model instance always showing empty ? #171

Closed rakibulalam closed 6 years ago

rakibulalam commented 6 years ago

there is no complete documentation to use with express.js.

masumsoft commented 6 years ago

express-cassandra is framework independent. There is nothing special you need to do to use it with express.js. You didn't provide any sample code that you tried, so it's difficult to guess what went wrong. But this is a common scenario that if you don't wait for the callback / promise to return, then you won't get the instances loaded.

So before you do app.listen, you need to have the models synced and callback / promise returned.

rakibulalam commented 6 years ago

Thank you for your reply. Finally i could able to solve the issue. i think that was my mistake, execute the query before establishing the instance.