Thursday, 18 May 2017

writing case expression in mongo-sql(An extensible SQL generation library)

I was using knex and wrote that query.

knex()
.columns(
'id',
this.knex.raw('case when u.password is null then true else false end as condition'))
.select()
.from(users as u);

Now, I am using mongo-sql. How can I write the code in mongo-sql ? I want to get user's password property as condition whether it is true or not. Any ideas ?



via Bahodir Boydedayev

No comments:

Post a Comment