harborn-digital / mongoaggregations Goto Github PK
View Code? Open in Web Editor NEWLibrary allowing easy access to the mongo aggregate framework
License: MIT License
Library allowing easy access to the mongo aggregate framework
License: MIT License
Make it possible to export the result of a an aggregation as CSV. Suggested API:
$result = $collection->aggregate($aggregationBuilder->build());
$csvBuilder = new CSVExport();
$csvBuilder->exportToFile($result, 'result.csv');
See #23
This library depends on phpunit, it should only do so in development.
Mongo Aggregations are powerful for reporting purposes. However Mongo does not support joins which makes it hard to report over multiple collections unless you've got a database design that uses embedded collections. This library should have a method to create a temporary collection that unreferences the references in the documents in a collection. A query may be added to the temporary collection to reduce overhead and increase performance.
API will look like:
$temporaryCollection = new EmbeddedCollection($collectionName, $query);
$result = $temporaryCollection->aggregate($aggregationBuilder->build());
$temporaryCollection->remove();
Make it possible to create expression objects as described in issue #34 using a builder.
Example:
Create expression manually:
$cond = new Condition();
$cond->setIf(new EqualsExpression('foo', 'foo'));
Use the builder:
$cond = new Condition();
$cond->setIf(ExpressionBuilder::build('foo == "foo"'));
See #25
A projection operation that results in 'myfield': '$myotherfield' should be added.
There should be better documentation including examples
The current CSVExporter should not be in the package. There should be a separate package defining an interface that can export data in a given format to another format. This package should depend on that to export (preprocessed) aggregation array to whatever format the package supports.
If can only be set using mongo arrays. A level of abstraction should be added to allow creating an if using an object. Example:
Current code:
$cond = new Condition();
$cond->setIfByArray(['$eq' => ['$foo', 'foo']]);
Should be possible:
$cond = new Condition();
$cond->setIf(new EqualsExpression('foo', 'foo'));
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.