GithubHelp home page GithubHelp logo

mongoaggregations's People

Contributors

ronrademaker avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

mongoaggregations's Issues

CSV export

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');

Fix dependencies

This library depends on phpunit, it should only do so in development.

Temporary embedded collection

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();

Create a builder for expression objects

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"'));

Field value operation

A projection operation that results in 'myfield': '$myotherfield' should be added.

Move export functionality to separate library

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.

Objects for if operations

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'));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.