Branching Question

I created my main database
Populated the data n the branch main
ran the queries successfully
I branched from main to branch_1
ran the same queries on the new branch_1 unsuccessfully - No Results

Why did my query fail on the new branch?

How can I write data to the new branch_1 with my javascript client?

My intent is to write data to both my main branch and the new branch_1 and then merge branch_1 back into the main branch.

I need to access any branch from my javascript client.

I will attempt to find something in your documentation.

Please respond.

orioncri

Hey orioncri,

So the steps which you have done seems correct and all data in main branch should be available in branch_1 and the queries should work, Could you maybe post your code and I can take a look at this?

Meanwhile, here’s the code to create a new branch using Javascript client

let branchName="branch_1"
client.branch(branchName)
    .then((results) => {
         console.log('results', results)
    })
    .catch((err) => console.log('error', err))
    .finally(() => console.log('do anything'))

To access any branch - you can use checkout() -

let branchName="branch_1"
client.checkout(branchName)
    .then((results) => {
         console.log('swaping to branch_1', results)
    })
    .catch((err) => console.log('error', err))
    .finally(() => console.log('do anything'))

Hope this helps :grinning:

1 Like

The checkout call does not have a then method.
All else worked good

1 Like

Woops, yeah your right checkout doesn’t have a then. Anyway glad it works :star_struck:

1 Like