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

Tell the developer which field has an invalid type. #191

Closed AlexisWilke closed 5 years ago

AlexisWilke commented 5 years ago

I wanted to make sure that the consistency could be specify in a query so I used:

let result = model.find({
    consistency: 'broken',
    ....
})

knowing that should not work and got that error saying there is a problem but really unhelpful if I were to add many fields all at the same time. Lucky for me, I knew exactly which field was wrong! Anyway, I think it's much better to let the developer know which field the system is not happy about.