Comments (5)
Hi. Could you please provide me some more details about your specific case?
Do you mean search by substring? Or this is about filtering rows by cell without knowing exact value of this cell?
Currently query builder has no methods to make such query in handy way, but you always can use raw formula.
If we talking about searching by substring, it can look something like that:
// find records where My Column value starts with foo
$query->whereRaw("REGEX_MATCH({My Column}, '^foo')");
You can also use values from other cells in your formula:
// find records where My Column contains value from Other Column
$query->whereRaw("REGEX_MATCH({My Column},('' & {Other Column} & ''))");
from airtable-php.
from airtable-php.
Sure, raw formula will work for you. Assume you look for users with name containing substring "Ivan". There are few options:
$query->whereRaw("REGEX_MATCH({Username}, 'Ivan')"); // case-sensitive, any place in cell
$query->whereRaw("REGEX_MATCH({Username}, '^Ivan')"); // case-sensitive, cell value must start with Ivan
$query->whereRaw("REGEX_MATCH({Username}, '(?i)Ivan')"); // case-insensitive, any place in cell
You can read more about regexp syntax here.
I think I could provide some convenient query builder methods for this later. Something like that:
$query->whereLike("Username", "Ivan");
$query->where("Username", "like", "Ivan%");
$query->whereMatch("Username", "(?i)ivan");
from airtable-php.
from airtable-php.
Implemented in v0.3.0
Few examples:
// look for emails, matching @gmail.com in case-insensitive way
$query->where('email', 'match', '(?i)^(.+)@gmail.com$');
// look for names, which starts with Ivan (case-sensitive!)
$query->where('name', 'like', 'Ivan%');
from airtable-php.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airtable-php.