SequoiaDB
 All Classes Functions
Public Member Functions | List of all members
bson.code.Code Class Reference
Inheritance diagram for bson.code.Code:

Public Member Functions

def __new__
 
def scope
 
def __repr__
 
def __eq__
 
def __ne__
 

Detailed Description

BSON's JavaScript code type.

Raises :class:`TypeError` if `code` is not an instance of
:class:`basestring` (:class:`str` in python 3) or `scope`
is not ``None`` or an instance of :class:`dict`.

Scope variables can be set by passing a dictionary as the `scope`
argument or by using keyword arguments. If a variable is set as a
keyword argument it will override any setting for that variable in
the `scope` dictionary.

:Parameters:
  - `code`: string containing JavaScript code to be evaluated
  - `scope` (optional): dictionary representing the scope in which
    `code` should be evaluated - a mapping from identifiers (as
    strings) to values
  - `**kwargs` (optional): scope variables can also be passed as
    keyword arguments

.. versionadded:: 1.9
   Ability to pass scope values using keyword arguments.

Member Function Documentation

def bson.code.Code.scope (   self)
Scope dictionary for this instance.

The documentation for this class was generated from the following file: