In my app, I'm implementing a questionnaire system and I'd like to implement tags for questions -- very similar to tags in questions here or Stack Overflow.
I wanted to get some advices on how to implement this as a property in my object. Should they be an array of strings -- as below?
{
"id": 123,
"question": "What is your favorite color?",
"tags": [
"personality trait",
"likes and dislikes"
]
}
Or is it better to use some type of identifier, instead of the actual verbiage?
{
"id": 123,
"question": "What is your favorite color?",
"tags": [1234, 89645]
}
I'm thinking about storing these questions in a NoSQL database and I want users to be able to run queries based on these tags. For example, if someone wants to pull all questions that are about "personality traits", I should be able to run a query that contains that particular tag.