Skip to content

Instantly share code, notes, and snippets.

@ahmadmarafa
Created May 23, 2019 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmadmarafa/c64656654e8d1ec0d0d8b962db5b7a1e to your computer and use it in GitHub Desktop.
Save ahmadmarafa/c64656654e8d1ec0d0d8b962db5b7a1e to your computer and use it in GitHub Desktop.
TBolier\RethinkQL getNearest with filter
<?php
$connection = r\connect("127.0.0.1" , null , "myApp") ;
$point = r\point((float) $request->pickup["lng"] , (float) $request->pickup["lat"]);
$data = r\table("connected")->getNearest($point , ["index" => "last_location"])->filter(
r\row("doc")("service_id")->eq( $request->service )
)->run($connection) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment