3 ms·
I dislike the `q.` too, for many reason. One of which is it's not copy/paste friendly from code to Shell. But it's just sugar, I basically write it the way you
by vadorequest 6y ago
I dislike the `q.` too, for many reason. One of which is it's not copy/paste friendly from code to Shell.
But it's just sugar, I basically write it the way you mentioned, by deconstructing `q`. See https://github.com/Vadorequest/rwa-faunadb-reaflow-nextjs-magic/blob/main/fauna/functions/current_user.ts https://github.com/Vadorequest/rwa-faunadb-reaflow-nextjs-ma...
- evanweaver 6y agoFauna has no native syntax, instead it has language-specific DSLs. This helps with type safety and query composability but it does indeed lead to awkward syntactical situations when the host language and Fauna semantics don’t quite align. The snippet in the grandparent post is JavaScript; is there an ORM or other library that has an example of an idiomatic JS or Typescript syntax that either of you would prefer?
- nicoburns 6y agoKnex syntax (http://knexjs.org/ http://knexjs.org/) is reasonable. It's basically method chaining.
- giorgioz 6y agomongodb is so well integrated with Javascript and JSON. db.collection().find({}) is just so fluent. I find all those capitalized functions in Fauna weird. In most C based languages like Javascript functions are lowercase. Would it be possible for the Fauna JS wrapper to also accept lowercased functions?
- mwakerman 6y agoI’ve really enjoy writing queries in RethinkDB’s [REQL language](https://rethinkdb.com/docs/introduction-to-reql/ https://rethinkdb.com/docs/introduction-to-reql/) > ‘r.table(“users”).filter(u => u(“email”).match(“.*@gmail.com$”)).run(conn)’
- giorgioz 6y agoany idea how to lowercase all those capitalized functions?