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

  • SEARCH
  • Home
  • 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 8779387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:46:29+00:00 2026-06-13T19:46:29+00:00

My second multi() call requires results from the first multi(). However I want all

  • 0

My second multi() call requires results from the first multi(). However I want all commands from both multi() to be executed atomically. How can I do this?

This is using the node.js client.

db.multi()
    .incr('next:user:id')
    .sadd('users:facebookid', facebookId)
    .exec(function(err, replies)
    {
        var newUserId = replies[0];
        // if something fails in this multi(), then the previous multi() shouldn't be executed either.
        db.multi()
        .hmset('user:' + newUserId , 'facebookId', facebookId, 'name', userName)
        .incr('users:count')
        .exec()

    });
  • 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-13T19:46:30+00:00Added an answer on June 13, 2026 at 7:46 pm

    You should be able to use redis EVAL to do complicated work in an atomic transaction. My understanding is the EVAL command is written to the tx log so even if redis crashes the whole command will either run to completion or not be performed at all.

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

Sidebar

Related Questions

I have an existing multi-threaded application which uses blocking connect() call. However, I want
I have a project where I need to compare multi-chapter documents to a second
Referring second answer to question: How to convert from ASCII to Hex and vice
What's the second minimum value that a decimal can represent? That is the value
I need to call a webservice from a PHP script. The web service is
I have multi-player game with a 30 second timer at the bottom of the
I am writing a simple multi-threaded buffer. It's purpose is to hold data from
Background: I've written a multi-threaded application in Win32, which I start from C# code
In Multi-Paxos algorithm, consider this message flow from the viewpoint of an acceptor: receive:
(second question today - must be a bad day) I have a dataframe with

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.