Comments (5)
@Timu57 deleteDocument
would it be a public API or internal method?
from sleekdb.
@rakibtg it will be a public method.
Because the Store class already has a delete method to delete a store we can not name the method delete and have to name it differently.
I also thought about naming the method deleteById
What do you think what could be the best fitting name?
from sleekdb.
@Timu57 Can't we already do that? Example:
$qb = $store->getQueryBuilder();
$foo = $qb->where("name", "=", "Foo")->getQuery();
print_r($foo->fetch());
$foo->delete();
from sleekdb.
@rakibtg yes we can.
But the following is much more convenient:
$store->deleteById($id);
We also could create a deleteBy
method:
function deleteBy($criteria, $returnOption = Query::DELETE_RETURN_BOOL): bool|int|array
$criteria
- ["city" => "london", "age" => 18]
$returnOption
- see return options constants at #77
from sleekdb.
@Timu57 I have mixed feeling for findBy
or deleteBy
because
- it might be a query consistency issue
- What if we add more conditional methods, or if i want to add search in the findBy method then every time we will need to add a new parameter, which i think would create more confusion
from sleekdb.
Related Issues (20)
- [Suggestion] Add support for JSON_PRETTY_PRINT HOT 2
- Math & Logic operations HOT 2
- nested column select and distinct return empty array HOT 3
- simple join approach
- SleekDB Extension of builtin "named functions" by users
- Allow to use UUIDs as primary keys HOT 2
- How to Run SleekDB HOT 4
- JSON Wildcard Notation HOT 2
- Incorrect escaping of characters?
- Select with alias at join HOT 5
- Class 'SleekDB\Store' not found HOT 2
- how we do search with join HOT 6
- Searching for value in array. HOT 2
- [Feature Request] Simple key-value lookup HOT 1
- [Feature Request] Searching from multiple stores HOT 1
- [SUGGESTION] please set config:timeout default to false HOT 2
- How to set special chars? HOT 7
- Use SleekDB as a readonly store HOT 2
- updateById method undefined HOT 3
- Group by Date
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sleekdb.