protected override bool CreateDocumentInternal(string name) { MongoDBDocument doc = new MongoDBDocument(name, this); doc.BeginWrite(true); doc.EndWrite(); return(true); }
protected override IDocument <Document, Document> GetDocumentInternal(string name) { MongoDBDocument doc = new MongoDBDocument(name, this); if (doc.Exists) { return(doc); } else { throw new AlexandriaException("The requested Document " + name + " is not present in this Store"); } }
protected override bool DeleteDocumentInternal(string name) { MongoDBDocument doc = new MongoDBDocument(name, this); if (!doc.Exists) { return(false); } Document mongoDoc = doc.BeginRead(); doc.EndRead(); this._db[Collection].Remove(mongoDoc); //For Triple-Centric schema there are many documents to delete if (this._schema == MongoDBSchemas.TripleCentric) { Document deleteTriples = new Document(); deleteTriples["graphuri"] = mongoDoc["uri"]; this._db[Collection].Remove(deleteTriples); } return(true); }
protected override bool HasDocumentInternal(string name) { MongoDBDocument doc = new MongoDBDocument(name, this); return(doc.Exists); }