Skip to content

"~" in query #17

Description

@luthfiset

Hey thanks for this great API, now I'm kinda used to it after 1 month coding
ok back to my question, can where clause use "~" ? in terminal we use it like this

/ip firewall mangle> print where connection-mark~"_2"
Flags: X - disabled, I - invalid, D - dynamic 
 0   chain=prerouting action=mark-packet new-packet-mark=5UP_2 passthrough=no 
     connection-mark=5UC_2 

 1   chain=prerouting action=mark-packet new-packet-mark=5DP_2 passthrough=no 
     connection-mark=5DC_2 

 2   chain=prerouting action=mark-packet new-packet-mark=5UJP_2 passthrough=no 
     connection-mark=5UJC_2 

 3   chain=prerouting action=mark-packet new-packet-mark=5DJP_2 passthrough=no 
     connection-mark=5DJC_2 

but when I try on API it doesn't work like on terminal, here's my code

$nbr = '2'

$req = new RouterOS\Request('/ip/firewall/mangle/print');
$req->setArgument('.proplist', '.id');
$req->setQuery(RouterOS\Query::where('new-connection-mark','_' . $nbr));
$ncm = $client->sendSync($req)->getProperty('.id');// Get new-connection-mark user id

$removeRequest = new RouterOS\Request('/ip/firewall/mangle/remove');
$removeRequest->setArgument('numbers', $ncm);
$client->sendSync($removeRequest);// Delete by new-connection-mark user

Or maybe something wrong with my code ? I don't know
But if it can use "~" like in terminal, it can be very helpful
Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions