Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 2.0

Is this an appropriate use of views

2 replies [Last post]
  • Login or register to post comments
Mon, 02/11/2013 - 08:06
peclements
Offline
Joined: 02/10/2013
Groups: None

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"
}
}
}
]
}

Top
  • Login or register to post comments
Tue, 02/12/2013 - 06:37
tgrall
Offline
Joined: 09/05/2012
Groups: None

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

Top
  • Login or register to post comments
Tue, 02/12/2013 - 06:55
peclements
Offline
Joined: 02/10/2013
Groups: None

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

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker