0

I´m Looking for search values into my Datastore but I need information filtered by value. I know Datastore is no relational DB, but how could I get the goal?

I´m trying this:

$ds = new DatastoreClient(['keyFilePath' => 'foo.json');
$q = $ds->gqlQuery('SELECT * FROM EMPLOYEES WHERE NAME LIKE "%$'.val.'%"');
$res = $ds->runQuery($q);

The LIKE keyword is not supported, What I can use instead?

Sammitch
  • 25,490
  • 6
  • 42
  • 70
Alberto Siurob
  • 157
  • 2
  • 14
  • https://cloud.google.com/datastore/docs/reference/gql_reference – Sammitch Jun 11 '18 at 17:47
  • 1
    https://stackoverflow.com/a/47811/1064767 – Sammitch Jun 11 '18 at 17:50
  • @Sammitch Could you post both links (with a short explanation) as an answer, please? [DanCornilescu](https://stackoverflow.com/users/4495081/dan-cornilescu) We are talking about different products here... I wouldn't mark this as a duplicate even if the information in the other post is useful. – Rubén C. Jun 12 '18 at 07:32
  • @RubénC. Fair enough, I retracted the vote. – Dan Cornilescu Jun 15 '18 at 03:19

1 Answers1

0

As Sammitch suggested, you can perform Datastore queries following the instructions described here or in this Stack Overflow post. The syntax is different, but the regular expression idea is the same.

Rubén C.
  • 1,012
  • 4
  • 15