goodybag / mongo-sql

An extensible SQL generation library for JavaScript with a focus on introspectibility

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

writing case expression

bakhodir10 opened this issue · comments

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 ?

@bakhodirsbox something like this work? http://mosql.j0.hn/#/snippets/av

@jrf0110 yes, it is working. Thanks