Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 1.5 KB

without.md

File metadata and controls

61 lines (45 loc) · 1.5 KB
layout api-command
language JavaScript
permalink api/javascript/without/
command without
io
sequence
stream
array
array
object
object
singleSelection
object
related_commands
pluck map
pluck/
map/

Command syntax

{% apibody %} sequence.without([selector1, selector2...]) → stream array.without([selector1, selector2...]) → array singleSelection.without([selector1, selector2...]) → object object.without([selector1, selector2...]) → object {% endapibody %}

Description

The opposite of pluck; takes an object or a sequence of objects, and returns them with the specified 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, callback)

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

r.table('enemies').without('weapons').run(conn, callback)

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

r.table('marvel').without({'weapons' : {'damage' : true}, 'abilities' : {'damage' : true}}).run(conn, callback)

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

r.table('marvel').without({'weapons':'damage', 'abilities':'damage'}).run(conn, callback)