Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

JavaScript Functions

EVAL(JavaScript command) 

...

New in 17.0 

The EVAL command takes a MongoDB JavaScript command and displays the result set in grid and tree views. Array data is returned in JSON format.

Examples



Code Block
EVAL(db.baseball.find())


Code Block
EVAL(db.baseball.explain().find())


Code Block
EVAL(db.baseball.insert({"teamName" : "Yankees", "city" : "New York"}))


Back to top

EVAL_ARRAY(JavaScript command) New in 17.0

The EVAL_ARRAY command takes a MongoDB JavaScript command and displays the result set in grid and tree views. Array data is flattened.

Example


Code Block
EVAL_ARRAY(db.baseball.find()) 


Back to top

Miscellaneous Functions

...

This function checks if a field exists in the document. It is used in the WHERE clause.

Example


Code Block
SELECT *
   FROM NewProducts 
   WHERE FIELD_EXISTS(city)


ARRAY_SIZE(arrayFieldName)

This function returns the number of elements in an array field. It is used in the WHERE clause.

Info

ARRAY_SIZE() can only be used with the "=" operator.

Example


Code Block
SELECT * 
   FROM NewProducts 
   WHERE ARRAY_SIZE(city) = 12


Back to top

INTERSECT clauses can be very CPU and RAM intensive because the resulting documents are compared and selected on the client side within Aqua Data Studio. Out of Memory Exceptions can occur if extremely large amounts of documents are compared and selected. See our Memory Configuration page on how to increase the RAM Aqua Data Studio uses.