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

Elegant way to determine whether a view exists? (.NET SDK)

No replies
  • Login or register to post comments
Mon, 11/26/2012 - 09:35
dbsanfte
Offline
Joined: 11/26/2012
Groups: None

I'm having a problem finding an elegant solution to this issue. I've discovered that you can find out that a view doesn't exist when you try to perform a query after attempting to retrieve the view:

var result = _couchClient.GetView<etc>("DocumentName", "ViewNameThatDoesNotExist");<br></etc><etc>result.Count(); // This returns a service exception </etc>

Count throws an exception, so at the moment I use a try/catch to determine if there is an exception. Is there a more elegant solution that doesn't require as many resources as performing a query? There doesn't seem to be anything like result.Exists() or something similar.

Thanks!

Top
  • 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