Giter Club home page Giter Club logo

Comments (5)

tobsn avatar tobsn commented on July 21, 2024 1

commented on Jun 15, 2013

5+ years for a reply :D

from mongolid-laravel.

Zizaco avatar Zizaco commented on July 21, 2024

About the minification

I'm not sure if I agree with that. The impact in performance will not be visible unless we are talking about billions of documents or documents with really huge names in keys. In fact, I believe that using this minification library for a small amout of documents, or for documents that doesn't have huge key names, would impact in a negatively way.

And I don't like the idea of having a strict schema using MongoDB. Thats one of the reasons why I (and alot of people) use it.

Plus, right now, you can overwrite the save / polymorph methods to do that (rename the keys before saving / after retrieving), and create your own basemodel class that read some schema files.

About the join

I'm not sure about it. Right now you can use the references many relation for that. Or you can implement the join method you're talking about in your basemodel:

public function join( $model )
{
    // Elaborate the attribute name. Ex: user_id
    $attrName = strtolower(get_class($this)).'_id';

    // Creates an instance to do the query
    $instance = new $model;

    // Query for where the attribute is equal to this _id
    $results = $instance->where(array(
        $attrName => $this->_id;
    ));

    // Return the results
    return $results;
}

But, about the example that you stated I believe that the best way to do this is using embedded documents instead of references.

Remember: MongoDB relationships doesn't works like in a Relational database. In MongoDB, data modeling decisions involve determining how to structure the documents to model the data effectively. The primary decision is whether to embed or to use references. See MongoDB - Data Modeling Decisions for more information on this subject.

from mongolid-laravel.

Zizaco avatar Zizaco commented on July 21, 2024

Custom migration class

Thats something that i'm planning to do :)

Adding events

Thats something I was forgeting about. I'm gonna implement that for sure.

Validation for Mongo

There is some build in validation in MongoLid. See the $rules and the isValid() method of this class. I will put that in the README. :_)

from mongolid-laravel.

tobsn avatar tobsn commented on July 21, 2024

minification: yeah true, but we are storing tons of data... probably gonna build something just for us.

remember: I'm using mongodb since 2009 - tons of docs in the mongo documentations are written by me :D

joins: https://github.com/mawelous/yamop we just did this internally for small projects, it's using "joins" as in referencing other collections dynamically without the need to declare it.

migrations: would be pretty damn useful, right now we're just seeding which is kinda annoying.

events: nice.

validation: must have missed that :(

anyway, good work on mongolid! I'm using mongodb with different languages for so long now that I build so many iterations of small classes but never had the time to finish a full implementation of everything. then I kinda forgot to check if anyone else might have done the work for me in the last 3 years ;) - thanks!

from mongolid-laravel.

ravanscafi avatar ravanscafi commented on July 21, 2024

No use-case and plans for minification right now.

from mongolid-laravel.

Related Issues (20)

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.