W3cubDocs

/RethinkDB Java

ReQL command: without

Command syntax

sequence.without([selector1, selector2...]) → stream
array.without([selector1, selector2...]) → array
singleSelection.without([selector1, selector2...]) → object
object.without([selector1, selector2...]) → object

Description

The opposite of pluck; takes an object or a sequence of objects, and returns them with the specified fields or paths removed.

Example: Since we don’t need it for this computation we’ll save bandwidth and leave out the list of IronMan’s romantic conquests.

r.table("marvel").get("IronMan").without("personalVictoriesList").run(conn);

Example: Without their prized weapons, our enemies will quickly be vanquished.

r.table("enemies").without("weapons").run(conn);

Example: Nested objects can be used to remove the damage subfield from the weapons and abilities fields.

r.table("marvel").without(
    r.hashMap("weapons", r.hashMap("damage", true))
     .with("abilities", r.hashMap("damage", true))
).run(conn);

Example: The nested syntax can quickly become overly verbose so there’s a shorthand for it.

r.table("marvel")
 .without(r.hashMap("weapons", "damage").with("abilities", "damage")).run(conn);

Related commands

Get more help

Couldn't find what you were looking for?

© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/api/java/without/