Skip to content

Using push and pull with a Model instance #147

@nsebban

Description

@nsebban

My issue is related to this one.

I have a User model, that has a 'friends' property that is an array. I would like to push and pull references to other users in it.

I thought the ::pull and ::push methods were exactly for that, but even though I can use them on a specific instance of my model, they have an effect on every single record on my collection, and not only on the one corresponding to my Model instance.

I'm not sure if it's a bug or a feature. In this other entry you mention the documentation, but I didn't find any specific information on that topic, beside an example.

Can someone please tell me a bit more about this ? Thanks a lot in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions