Is this an appropriate use of views
Hi,
I have a document for which I want to be able to count or even identify those documents which have a particular view, see example at bottom of this email.
Having attempted to use views and map/reduce to accomplish this and have come up with nothing, the problem being I cannot seem to get it to drill into the array in order to do the count.
Can someone point this complete beginner in the right direction.
Many thanks in advance
Paul
Single document which shows two views of the same object, sometimes though there is only one view and other times there could be multiple views
{
"test": [
{
"view1": {
"a": {
"a_header": "x",
"a_tail" : "y"
}
}
},
{
"view2": {
"b": {
"b_header": "f",
"b_tail" : "g"
}
}
}
]
}
Hi,
I have a document with a unique identifier X which is held in form X1
Client application A wants X1 in the form A1
Client application B wants X1 in the form B1
Now the cost of the transformation from X1 to either A1 or B1 is expensive and therefore we would like to hold these views in some cache.
I can see two approaches (probably loads more)
1. Is we have a document stored as X-A1 and another X-B1
2. The other approach I was trying to come up with was have an aggregated document which has an array of these views and dependent on the request provide the appropriate view - was seeing if views could help with this.
Does that make sense and thanks for your help
Paul
Hello Paul,
Sorry I do not understand what you are trying to do.
Could you please explain with more details what you want to do with your documents? and views?
And I will try to guide you to the proper way.
Regards
Tug
@tgrall