Check if value exists in a set

83 views
Skip to first unread message

Ezra Match

unread,
Dec 6, 2023, 1:08:18 PM12/6/23
to rama-user
Hi all,

I've been enjoying learning Rama.

I have a pstate with a set. I'm wondering how to check if a value exists in the set.

Thanks!
Ezra

Nathan Marz

unread,
Dec 6, 2023, 1:20:59 PM12/6/23
to rama...@googlegroups.com
You can do that with the Java API like this:

.localSelect("$$p", Path.key("*userId").view(Ops.CONTAINS, "*element")).out("*inSet?")

That second argument to "view" doesn't have to be a variable and can be a constant value as well.

With the Clojure API it's the same general idea, but you would use an anonymous <<ramafn with the "view" call.

--
You received this message because you are subscribed to the Google Groups "rama-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rama-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rama-user/f82e224b-4d78-4592-9826-990caa74c294n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages