Couchbase will always write to memory first but it will flush the documents to disk as space is needed. This means that you can do a normal write, and if the document is not accessed it will be removed from memory and only the disk version remains. The only thing which stays in memory is a small amount of meta data, which holds the key, and some other small values, not the document contents.
That being said, if I understand right the document you want to write is 500MB? That is a really large document, and even though it is theoretically possible to write it we limit the document size to 20MB right now, what you should do in this case is split the document in multiple smaller ones so you basically get a chunked version of the document. You could also take a look at CBFS for example to use as a blob store for those kind of documents.