Skip to content

Commit

Permalink
fixed indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalill committed Jul 10, 2023
1 parent 8b982e1 commit 28f4fb4
Showing 1 changed file with 45 additions and 22 deletions.
67 changes: 45 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ $attribute = new Document([
'filters' => [],
]);

$database->checkAttribute($collection, $attribute);
$database->checkAttribute(
collection: $collection,
attribute: $attribute
);

// Get Adapter attribute limit
$database->getLimitForAttributes(); // if 0 then no limit
Expand Down Expand Up @@ -639,7 +642,11 @@ $document = new Document([
'active' => true,
'genres' => ['science fiction', 'action', 'comics'],
]);
$document = $database->createDocument(collection: 'movies', document: $document);

$document = $database->createDocument(
collection: 'movies',
document: $document
);

// Get which collection a document belongs to
$document->getCollection();
Expand Down Expand Up @@ -739,32 +746,42 @@ $possibleQueries =
];


$database->find(collection: 'movies', queries: [
$possibleQueries[0],
$possibleQueries[1],
], timeout: 1); //timeout is optional
$database->find(
collection: 'movies',
queries: [
$possibleQueries[0],
$possibleQueries[1],
],
timeout: 1); //timeout is optional

// Find a document
$database->findOne(collection: 'movies', queries: [
$possibleQueries[0],
$possibleQueries[1],
]
$database->findOne(
collection: 'movies',
queries: [
$possibleQueries[0],
$possibleQueries[1],
]
);

// Get count of documents
$database->count(collection: 'movies', queries: [
$possibleQueries[0],
$possibleQueries[1],
],
max: 1000); // max is optional
$database->count(
collection: 'movies',
queries: [
$possibleQueries[0],
$possibleQueries[1],
],
max: 1000); // max is optional
);

// Get the sum of an attribute from all the documents
$database->sum(collection: 'movies', attribute: 'price', queries: [
$possibleQueries[0],
$possibleQueries[1],
],
max: 0 // max = 0 means no limit
$database->sum(
collection: 'movies',
attribute: 'price',
queries: [
$possibleQueries[0],
$possibleQueries[1],
],
max: 0 // max = 0 means no limit
);

// Encode Document
Expand All @@ -775,10 +792,16 @@ $document = $database->getDocument(
id: $document->getId()
);

$database->encode(collection: $collection, document: $document);
$database->encode(
collection: $collection,
document: $document
);

// Decode Document
$database->decode(collection: $collection, document: $document);
$database->decode(
collection: $collection,
document: $document
);

// Delete a document
$database->deleteDocument(
Expand Down

0 comments on commit 28f4fb4

Please sign in to comment.