see on GitHub

Migration : DatabaseCommands has been removed

IDatabaseCommands and IAsyncDatabaseCommands has been replaced in RavenDB.Client 4.0 by operations. Please read the dedicated documentation section about operations available in the client API.

Checking if document exists

3.x 4.0
var exists = store.DatabaseCommands.Head(id) != null;
var exists = session.Advanced.Exists(id);