josephg / ShareJS

Collaborative editing in any app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to inform the client when init a `doc` that whether the `doc` exists or not?

a0x opened this issue · comments

In the Wiki I found that a Document is identified by collection and name, aka:

Connection.prototype.get = function(collection, name, data) {
  ...
  return doc;
};

I wrote like this to create a doc:

// Don't worry about `collection` since it is a fixed value, 
// `name` is sometimes different because I need it to be, 
// so that I can create different docs for users to cooperate with.
doc = connection.get(collection, name)

My question is how to inform the client(web browser) when initing a doc that whether the doc exists or not ?