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

PHP SDK Delete

1 reply [Last post]
  • Login or register to post comments
Thu, 12/27/2012 - 06:49
biswajit
Offline
Joined: 03/28/2012
Groups: None

Can you please confirm this?

I am trying to remove a document via http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-update-delete.html#table-couchbase-sdk_php_delete.

the code snippet :

var_dump($CB->delete("DOCUMENT_UUID"));
The output coming as
string(1) "0"
But data is getting removed.

And when the DOCUMENT_UUID is not present, its returning
bool(false)

In PHP most of the cases 0 represents False. :(
Like

if(0)
    {
    // This not happen.
    }
if(false)
    {
    // This not happen as above.
    }

Is that it supposed to do?

Can somebody confirm this?

Top
  • Login or register to post comments
Thu, 12/27/2012 - 11:19
daschl
Offline
Joined: 05/19/2012
Groups: None

I recommend you to use the === comparator always in PHP to remedy exactly this kind of situation. If you then compare it with === false, it should work as expected!

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