I want Couchbase to first temporary store the data, and then automatically sync it with Server. How do I achieve this ?
For example, In note-making app, I add a note and Couchbase should automatically add it to the Server.
You're in luck! The requirement you've described is exactly how Couchbase Mobile works.
Couchbase Mobile is comprised of two parts:
So, back to your question. In order to achieve what you're looking for you would first create an instance of your Couchbase Lite database. From there, as you would expect, you can perform basic CRUD operations, query data, etc. You can find more information on the built-in capabilities here:
Once you've created an embedded database you can start replication (synchronization) on it by using the Sync Gateway integration that comes with the Couchbase.Lite and Couchbase.Lite.Enterprise SDK component for iOS, Android, or Xamarin.
I recommend checking out the following tutorials for using Couchbase Lite and Sync Gateway: