Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8831707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:22:18+00:00 2026-06-14T08:22:18+00:00

I just follow this post to test Couchbase View.When edit view use Couchbase GUI

  • 0

I just follow this post to test Couchbase View.When edit view use Couchbase GUI and save,the view didn’t update immediately.

For example.With php scripts store some array to Couchbase.And define a named ‘last’ view in ‘dev_sessions’ document:

function (doc) {
if(doc.namespace == 'sessions') {
emit(doc.lastSeen, 1);
}
}

Then use curl to get the json result.
First time:

$ curl
http://192.168.228.134:8092/default/_design/dev_sessions/_view/last/?group_level=1&reduce=true'
{"rows":[ ] }

Second:

$ curl 'http://192.168.228.134:8092/default/_design/dev_sessions/_view/last/?group_level=1&reduce=true'
{"rows":[
{"key":1352872218,"value":1},
{"key":1352879418,"value":3}
]
}

Another test,add a new array in php scripts:

'eb255262434407766f212d1b6f23' => array(
'namespace' => 'sessions',
"type" => "user",
"userID" => "1107",
'lastSeen' => time(),
'firstSeen' => time(),
"remoteAddress" => "2.3.4.5",
"location" => "Vienna/Austria",
"name" => "Golden K"

Run curl again,first time:

$ curl 'http://192.168.228.134:8092/default/_design/dev_sessions/_view/last/?group_level=1&reduce=true'
{"rows":[
{"key":1352872218,"value":1},
{"key":1352879418,"value":3}
]
}

Second time:

$ curl 'http://192.168.228.134:8092/default/_design/dev_sessions/_view/last/?group_level=1&reduce=true'
{"rows":[
{"key":1352875163,"value":1},
{"key":1352882363,"value":4}
]
}

If changed data or view script,click Views - 'Show Results' button in Couchbase GUI,the first & second time does different.
Why View not update immediately?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:22:20+00:00Added an answer on June 14, 2026 at 8:22 am

    This is the expected behavior. Couchbase is by default “updating” the index after the call of the view. And this to have faster response time.

    When executing a view you can control the status of the view (in fact its index) using the stale parameter.

    In your case just do a:

    curl 'http://192.168.228.134:8092/default/_design/dev_sessions/_view/last/?group_level=1&reduce=true&stale=false'
    

    And it will update the index before returning the data to your application.

    You can find in the documentation all the information about this parameter and how the views are working:

    http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-writing-stale.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to follow the example in this post by tvanfosson . I just
I all, I just follow this great example: http://qt-project.org/doc/qt-4.8/tools-customcompleter.html I copy the code exactly
I have been trying to follow the example in this post . Since I
I just follow this DIHQuickStart , try to import data to solr from mysql.
Just a follow up question to this one here => link Is it possible
This is a follow up from a question of mine that was just answered
This is a follow up post to this one: Recursively search nested lists I've
I'm trying to follow the instructions laid out in this post , but I'm
Follow up on this post I made earlier on. I found out XML actually
this is my first post so if you need clarificatrion on anything then just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.