ravendb/ravendb-php-client

5.2.0beta1 2022-08-31 10:20 UTC

This package is not auto-updated.

Last update: 2022-09-29 18:22:00 UTC


README

Introduction

PHP client API (v5.2) for RavenDB , a NoSQL document database.

Package has been made to match Java and other RavenDB clients

Please note that RavenDB PHP client is still under DEVELOPMENT and client API can be changed.

Installation

In order to add this library to your project, first you must add the following line to your project composer.json:

{ 
    ...
    "minimum-stability": "dev",
    ... 
}

Then you can install library to your project via Composer

$ composer require ravendb/ravendb-php-client

How to start with RavenDB in PHP?


use RavenDB\Documents\DocumentStore;
use YourClass\Company;

$store = new DocumentStore(["http://localhost:8080" ], "Northwind")

try {
    $store->initialize();
    
    $companyId = null;
    
    //store new object
    $session = $store->openSession();
    try {
        $entity = new Company();
        $entity->setName("Company");
        $session->store($entity);
        $session->saveChanges();
    
        // after calling saveChanges(), an id field if exists
        // is filled by the entity's id
        $companyId = $entity->getId();
    } finnaly {
        $session->close();
    }
    
    $session = $store->openSession();
    try {
        //load by id
        $entity = $session->load(Company::class, $companyId);
    
        // do something with the loaded entity
    } finnaly {
        $session->close();
    }

} finally {
    $store->close();
}

Read more about RavenDB and how to use it in our documentation.

What's new?

5.2.0beta1

  • session

    • ability to track objects
    • crud
    • include
    • no tracking
  • indexes

    • crud (static/auto)
    • modify state: (setting index priority, enabling/disabling indexes, start/stop index, list/clean indexing errors, getting terms)
  • query

    • static/dynamic indexes
    • document query methos (where equals, starts with, etc)
    • aggregation (group by )
    • count, order, take/skip
    • boost, proximity, fuzzy
    • select fields (projection)
    • delete/patch by query
  • https support

    • certificates crud
    • request executor
  • compare exchange

    • crud
    • session
  • patch

    • by script
    • by path
  • databases

    • crud

The client is still in the beta phase.

RavenDB Documentation

https://ravendb.net/docs/

Bug Tracker

http://issues.hibernatingrhinos.com/issues/RDBC

License

The MIT License (MIT). Please see License File for more information.