question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

and where logic operator missing ?

See original GitHub issue

Hi,

How do I use logical AND operator in chain ? Ex :

...
.where('x.b', 3)
.andWhereIn('x.a', [1, 2, 3])
.andWhereNotNull('x.c')

There is not operator andWhereIn and andWhereNotNull ?

Best regards,

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
elhigucommented, Jan 26, 2017

@purell

and variants are just aliases for normal where so you can use them like this:

...
.where('x.b', 3)
.whereIn('x.a', [1, 2, 3])
.whereNotNull('x.c')

We should update the list of and variants though… so I’ll mark this as a bug.

1reaction
RobIsHerecommented, Jul 6, 2021

Would be great to have this “where() and andWhere() are aliases” documented. It really makes things easier. I just searched for this fact, because my gut told me that maybe they are aliases.

With this knowledge it’s easy to gather applicable criteria of where in an array first and do a […].forEach(criteria => builder.where(criteria) ) when ready.

Instead of a = […] if (a.length) builder.where(criteria[0]); for (i = 1; (i < a.length); i++){ builder.andWhere(criteria[i]); }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing Values and Logical Operators (IF command) - IBM
When two or more relations are joined by logical operators AND or OR , the program always returns a missing value if all...
Read more >
and where logic operator missing ? #1881 - knex/knex - GitHub
Hi, How do I use logical AND operator in chain ? ... andWhereNotNull('x.c') There is not operator andWhereIn and andWhereNotNull ?
Read more >
FAQ: Logical expressions and missing values - Stata
Why does Stata treat missing values in this way? It is not possible with two-valued logic (True–False) to have missing values propagate through ......
Read more >
Operators & Missing Value in R - TechnicalJockey
Objects Missings : A missing value is one whose value is unknown. Missing values in R represented by NA symbol. ... Logical Operators...
Read more >
Understanding Errors: G0064 Operand Missing - Aptech
Operand Missing Errors with Mathematical and Logical Operators ; The element-by-element multiplication operator requires two operands, one on the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found