Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How would this be used with a non-relational database (e.g. MongoDB)? #89

Closed
pryley opened this issue Sep 19, 2014 · 1 comment
Closed

Comments

@pryley
Copy link

pryley commented Sep 19, 2014

Stapler migrations work great for relational databases, but what if we are implementing a non-relational database?

I am using MongoDB and implementing Stapler stores the avatar images in the user database like so:

"users": [
    {
        "_id" : ObjectId("541c513bb77859e203000002"),
        "avatar_file_name": "",
        "avatar_file_size": "",
        "avatar_content_type": "",
        "avatar_updated_at": ""
    }
]

This is not ideal. Here is an example of how it needs to be stored, the User table/collection is "users" and looks like this for storing the avatar:

"users": [
    {
        "_id" : ObjectId("541c513bb77859e203000002"),
        "meta": {
            "avatar": {
                "file_name": "",
                "file_size": "",
                "content_type": "",
                "updated_at": ""
            }
        }
    }
]

OR

"users": [
    {
        "_id" : ObjectId("541c513bb77859e203000002"),
        "meta": {
            "avatar": {
                "avatar_file_name": "",
                "avatar_file_size": "",
                "avatar_content_type": "",
                "avatar_updated_at": ""
            }
        }
    }
]

How would I do this?

I am using https://github.com/jenssegers/Laravel-MongoDB to add MongoDB support to Laravel.

@tabennett
Copy link
Contributor

We're not currently supporting MongoDB at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants