Sync gateway insert vs N1QL insert

Hello,

What would be the major difference for inserting a document through sync gateway vs inserting through N1QL query. What I observed is when we created document with N1QL, it doesn’t have _sync object in it. Will the document sync to Couchbase lite if it doesn’t have _sync object. Please help me with sone info.

Thanks

@Ajay_Koppisetty, if you create document with N1QL, it creates document on couchbase server and then replicate to sync gateway if you have enabled"import_docs": true,’ '“enable_shared_bucket_access”: true in sync gateway config. As it is created in couchbase server, you won’t see ‘_sync’ key in the document.
Yes it will sync/replicate to couchbase lite for the document created with N1QL as well along with documents created in sync gateway

Thank you @sridevi.saragadam for the information!