ODM
Direct Subclass:
Object Data Model Generic class to model an entity in the program (saved into an ElasticSearch DB).
Static Method Summary
Static Public Methods | ||
public static |
|
|
public static |
|
|
public static |
async count(index: string, type: string, client: Object, model: Object, search: Search): Promise<Object> |
|
public static |
|
|
public static |
async deleteByQuery(index: string, type: string, client: Object, search: Search) |
|
public static |
async fetch_mapping(index: string, type: string, client: Object, include_meta: boolean): * |
|
public static |
async fetch_settings(index: string, type: string, client: Object): * |
|
public static |
format_hit(hit: Object, found: boolean): Object Process an entity and create an {ODM} object. |
|
public static |
async pre_create_hook(index: string, type: string, client: Object, model: Object, body: Object): Promise<boolean> |
|
public static |
async pre_update_hook(index: string, type: string, client: Object, model: Object, body: Object, id: string): Promise<boolean> |
|
public static |
async read(index: string, type: string, client: Object, model: Object, response: Object, population: Array<String>, backward: boolean): Object |
|
public static |
|
|
public static |
async search(index: string, type: string, client: Object, model: Object, search: Search, opts: Object): Promise<Object> |
|
public static |
async update(index: string, type: string, client: Object, model: Object, body: Object, id: string): PromiseODM> |
Static Private Methods | ||
private static |
async _bulk_create_or_update(index: string, type: string, client: Object, body: Array<Object>, action: string): PromiseODM> |
|
private static |
async _create_or_update(index: string, type: string, client: Object, model: Object, body: Object, id: string): PromiseODM> |
Constructor Summary
Public Constructor | ||
public |
constructor(client:: *, id:: *) |
Member Summary
Public Members | ||
public get |
Get all information about an entity; |
|
public set |
Set all interesting information about an entity |
|
public get |
Get id of an entity (possibly null) |
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
Get name of the class (= entity) |
|
public get |
|
|
public get |
|
Private Members | ||
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
Method Summary
Public Methods | ||
public |
|
|
public |
|
|
public |
async post_create_hook() |
|
public |
async post_read_hook(population: Array<String>) |
|
public |
async post_update_hook() |
|
public |
async pre_read_hook() |
|
public |
|
|
public |
|
Private Methods | ||
private |
async _handle_population(population: Array<String>, propagate_population: boolean) |
Static Public Methods
public static async bulk_create(index: string, type: string, client: Object, body: Array<Object>): PromiseODM> source
public static async bulk_update(index: string, type: string, client: Object, body: Array<Object>): PromiseODM> source
public static async count(index: string, type: string, client: Object, model: Object, search: Search): Promise<Object> source
public static async create(index: string, type: string, client: Object, model: Object, body: Object): PromiseODM> source
public static async deleteByQuery(index: string, type: string, client: Object, search: Search) source
public static async fetch_mapping(index: string, type: string, client: Object, include_meta: boolean): * source
Return:
* |
public static format_hit(hit: Object, found: boolean): Object source
Process an entity and create an {ODM} object.
public static async pre_create_hook(index: string, type: string, client: Object, model: Object, body: Object): Promise<boolean> source
public static async pre_update_hook(index: string, type: string, client: Object, model: Object, body: Object, id: string): Promise<boolean> source
public static async read(index: string, type: string, client: Object, model: Object, response: Object, population: Array<String>, backward: boolean): Object source
public static async remove(index: string, type: string, client: Object, id: string): Promise<boolean> source
public static async search(index: string, type: string, client: Object, model: Object, search: Search, opts: Object): Promise<Object> source
public static async update(index: string, type: string, client: Object, model: Object, body: Object, id: string): PromiseODM> source
Static Private Methods
private static async _bulk_create_or_update(index: string, type: string, client: Object, body: Array<Object>, action: string): PromiseODM> source
Public Constructors
public constructor(client:: *, id:: *) source
Params:
Name | Type | Attribute | Description |
client: | * | ElasticSearch client; |
|
id: | * | id of the entity (could be null) |
Public Members
public get db: *: Object source
Get all information about an entity;
Return:
* | all interesting information |
Private Members
Public Methods
public async post_create_hook() source
public async post_update_hook() source
public async pre_read_hook() source
public async read(opts: Object): Promise<ODM> source
Params:
Name | Type | Attribute | Description |
opts | Object |
|