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

Variable Keys #1522

Closed
CodersBrothers opened this issue Jun 10, 2013 · 4 comments
Closed

Variable Keys #1522

CodersBrothers opened this issue Jun 10, 2013 · 4 comments
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature

Comments

@CodersBrothers
Copy link

Objects JSON can use variable keys. Will be good that with mongoose we can define variable keys.

Some question with same.
http://stackoverflow.com/questions/11183480/how-to-set-key-by-var-in-mongoose-node-js
https://groups.google.com/forum/?fromgroups#!topic/mongoose-orm/hEabQU6bD6k
http://stackoverflow.com/questions/14195991/mongoose-variable-key-name
http://stackoverflow.com/questions/11133912/how-to-use-a-variable-as-a-field-name-in-mongodb-native-findandmodify

@CodersBrothers
Copy link
Author

For example for something like:

{
    'name': 'Sports',
    'icons': {
    16: "images/logo16.png",
    32: "images/logo32.png",
    48: "images/logo48.png",
    64: "images/logo64.png",
    128: "images/logo128.png"
    }
}

@CodersBrothers
Copy link
Author

Because if not is posible, we can convert the result to work as res.icons['16'] with underscore or crazy things :S
Or maybe not is the best way for do this?

@vkarpov15
Copy link
Collaborator

Closing this in favor of #681, same issue just older and with more subscribers.

@vkarpov15
Copy link
Collaborator

This feature is now in Mongoose, see maps

@Automattic Automattic locked as resolved and limited conversation to collaborators Feb 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
Projects
None yet
Development

No branches or pull requests

2 participants