Comments (5)
commented on Jun 15, 2013
5+ years for a reply :D
from mongolid-laravel.
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.
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.
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.
No use-case and plans for minification right now.
from mongolid-laravel.
Related Issues (20)
- Support and Branch strategy HOT 1
- Migrations support HOT 2
- Mongolid Laravel Banner HOT 1
- Support for queue failed jobs HOT 2
- Laravel Socialite+Passport
- Undefined index: driver HOT 3
- AbstractModel::first returns generic object? HOT 3
- How to write monogodb query log? HOT 2
- Support for laravel 7 HOT 1
- InvalidArgument - MongolidUserProvider::__construct expects MongolidLaravel\MongoLidModel, User::class provided
- How do relationship with mysql
- No suitable servers found (serverSelectionTryOnce set): [connection error calling hello on '127.0.0.1:27017']
- create legacy laravel model builder methods?
- Allow extend fillable and rules
- Clear errors
- Date Validation
- Search with aggretation and commands HOT 3
- Possible on PHP 5? HOT 3
- composer install problem with laravel v5.4.23 HOT 3
- Class 'MongolidLaravel\MongolidServiceProvider' not found HOT 11
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 mongolid-laravel.