Python OJAI Client API
ojai.Document.Document Class Reference

Public Member Functions

def set_id (self, _id)
 
def get_id (self)
 
def size (self)
 
def empty (self)
 
def set (self, field_path, value)
 
def delete (self, field_path)
 
def get_str (self, field_path)
 
def get_boolean (self, field_path)
 
def get_int (self, field_path)
 
def get_long (self, field_path)
 
def get_float (self, field_path)
 
def get_time (self, field_path)
 
def get_date (self, field_path)
 
def get_timestamp (self, field_path)
 
def get_binary (self, field_path)
 
def get_interval (self, field_path)
 
def get_dictionary (self, field_path)
 
def get_list (self, field_path)
 
def as_dictionary (self)
 

Detailed Description

Abstract class of OJAI Document, which describe all supported functional

Member Function Documentation

◆ as_dictionary()

def ojai.Document.Document.as_dictionary (   self)
Representing the Document into dictionary
:return a new dictionary representing the Document

◆ delete()

def ojai.Document.Document.delete (   self,
  field_path 
)
Deletes the value at the specified FieldPath if it exists.
:param field_path: the FieldPath to delete from the document. Type may be FieldPath, str.
:return document itself

◆ empty()

def ojai.Document.Document.empty (   self)
Removed all of the entries from the document

◆ get_binary()

def ojai.Document.Document.get_binary (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as bytearray

◆ get_boolean()

def ojai.Document.Document.get_boolean (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as bool

◆ get_date()

def ojai.Document.Document.get_date (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as ODate

◆ get_dictionary()

def ojai.Document.Document.get_dictionary (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as dictionary

◆ get_float()

def ojai.Document.Document.get_float (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as float

◆ get_id()

def ojai.Document.Document.get_id (   self)
Method returns _id field of the Document

◆ get_int()

def ojai.Document.Document.get_int (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as int

◆ get_interval()

def ojai.Document.Document.get_interval (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as OInterval

◆ get_list()

def ojai.Document.Document.get_list (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as list

◆ get_long()

def ojai.Document.Document.get_long (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as long

◆ get_str()

def ojai.Document.Document.get_str (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as str

◆ get_time()

def ojai.Document.Document.get_time (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as OTime

◆ get_timestamp()

def ojai.Document.Document.get_timestamp (   self,
  field_path 
)
Returns the value at the specified fieldPath.
:param field_path: the path to get from the document. Type may be FieldPath, str.
:return value at the specified field_path as OTimestamp

◆ set()

def ojai.Document.Document.set (   self,
  field_path,
  value 
)
Sets the value of the specified fieldPath in this Document to the
specified String.
:param field_path: the FieldPath to set. Type may be str and FieldPath.
:param value: the value. Type may be bool, byte, long, float, OTime, ODate, OTimestamp, OInterval,
bytearray, dictionary, Document, Value, list, None.
:return document itself

◆ set_id()

def ojai.Document.Document.set_id (   self,
  _id 
)
Sets the the "_id" field of this Document to the specified Value.
    :param _id: The value of _id field. Type may be str, Value, bytearray

◆ size()

def ojai.Document.Document.size (   self)
:return the number of top level entries in the document

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