Documentation

DataMongoDB
in package

Table of Contents

Properties

$_collections  : mixed
$_debug  : mixed
$_lastQuery  : mixed
$error  : mixed
$errorMsg  : mixed
$limit  : mixed
$page  : mixed
$sendSysLogs  : mixed
$uri  : mixed
$_client  : Client
$core  : Core7

Methods

__construct()  : mixed
addError()  : bool
Error Functions
connect()  : bool
Stablish a connection with MONGODB
deleteById()  : array<string|int, mixed>|void
Execute a deletion based on id https://docs.mongodb.com/php-library/current/reference/method/MongoDBCollection-deleteOne/
find()  : array<string|int, mixed>|void
Execute a find action over a collection
findIds()  : array<string|int, mixed>|void
Execute a find action over a collection and return only the keys
getById()  : array<string|int, mixed>|null
Execute a find action over a $id
getCollections()  : array<string|int, mixed>|void
Get the list of collections of a Mongo Database
getDatabases()  : array<string|int, mixed>|void
Get the list of databases of a Mongo Conection
getIndexes()  : array<string|int, mixed>|void
Execute a find action over a collection and return only the keys
getLastQuery()  : null|strig
Return the last query value set in a find o update operation
insertDocuments()  : array<string|int, mixed>|void
Execute an insertion of one or multiple documents https://docs.mongodb.com/php-library/current/reference/method/MongoDBCollection-insertOne/
updateDocumentWithId()  : array<string|int, mixed>|void
Execute an update of one document. This document requires a _id field https://docs.mongodb.com/php-library/current/reference/method/MongoDBCollection-insertOne/
connectWithCollection()  : mixed|Collection
Return a Collection to operate with
prepareTypes()  : void
Transform _id fields and date contents into MongoDB objects
transformTypes()  : void
Transform Mongo objects in arrays, strings , numbers

Properties

Methods

__construct()

public __construct(Core7 &$core[, mixed $uri = '' ]) : mixed
Parameters
$core : Core7
$uri : mixed = ''

addError()

Error Functions

public addError(mixed $err) : bool
Parameters
$err : mixed
Return values
bool

connect()

Stablish a connection with MONGODB

public connect([mixed $uri = '' ]) : bool
Parameters
$uri : mixed = ''
Return values
bool

True if connection is ok.

deleteById()

Execute a deletion based on id https://docs.mongodb.com/php-library/current/reference/method/MongoDBCollection-deleteOne/

public deleteById( $db,  $collection, mixed $id) : array<string|int, mixed>|void
Parameters
$db :
$collection :
$id : mixed
Return values
array<string|int, mixed>|void

find()

Execute a find action over a collection

public find( $db,  $collection[,  $filter = [] ][, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>|void
Parameters
$db :
$collection :
$filter : = []
$options : array<string|int, mixed> = []

[projection=>array,sort=array,skip=>integer,limit=>integer,comment=>string,returnKey=>boolean,]. More info in https://docs.mongodb.com/php-library/current/reference/method/MongoDBCollection-find/

Return values
array<string|int, mixed>|void

findIds()

Execute a find action over a collection and return only the keys

public findIds( $db,  $collection[,  $filter = [] ][, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>|void
Parameters
$db :
$collection :
$filter : = []
$options : array<string|int, mixed> = []

[sort=array,skip=>integer,limit=>integer,comment=>string,returnKey=>boolean,]. More info in https://docs.mongodb.com/php-library/current/reference/method/MongoDBCollection-find/

Return values
array<string|int, mixed>|void

getById()

Execute a find action over a $id

public getById( $db,  $collection,  $id) : array<string|int, mixed>|null
Parameters
$db :
$collection :
$id :

String

Return values
array<string|int, mixed>|null

getCollections()

Get the list of collections of a Mongo Database

public getCollections(mixed $db) : array<string|int, mixed>|void
Parameters
$db : mixed
Return values
array<string|int, mixed>|void

getDatabases()

Get the list of databases of a Mongo Conection

public getDatabases() : array<string|int, mixed>|void
Return values
array<string|int, mixed>|void

getIndexes()

Execute a find action over a collection and return only the keys

public getIndexes( $db,  $collection) : array<string|int, mixed>|void
Parameters
$db :
$collection :
Return values
array<string|int, mixed>|void

getLastQuery()

Return the last query value set in a find o update operation

public getLastQuery() : null|strig
Return values
null|strig

insertDocuments()

Execute an insertion of one or multiple documents https://docs.mongodb.com/php-library/current/reference/method/MongoDBCollection-insertOne/

public insertDocuments( $db,  $collection,  $documents) : array<string|int, mixed>|void
Parameters
$db :
$collection :
$documents :
Return values
array<string|int, mixed>|void

updateDocumentWithId()

Execute an update of one document. This document requires a _id field https://docs.mongodb.com/php-library/current/reference/method/MongoDBCollection-insertOne/

public updateDocumentWithId( $db,  $collection,  $update_info) : array<string|int, mixed>|void
Parameters
$db :
$collection :
$update_info :
Return values
array<string|int, mixed>|void

connectWithCollection()

Return a Collection to operate with

private connectWithCollection( $db,  $collection) : mixed|Collection
Parameters
$db :
$collection :
Return values
mixed|Collection

prepareTypes()

Transform _id fields and date contents into MongoDB objects

private prepareTypes(array<string|int, mixed> &$entity[, int $level = 0 ]) : void
Parameters
$entity : array<string|int, mixed>
$level : int = 0

transformTypes()

Transform Mongo objects in arrays, strings , numbers

private transformTypes(array<string|int, mixed> &$entity[, int $level = 0 ]) : void
Parameters
$entity : array<string|int, mixed>
$level : int = 0

        
On this page

Search results