Beispiel #1
0
        protected override bool CreateDocumentInternal(string name)
        {
            MongoDBDocument doc = new MongoDBDocument(name, this);

            doc.BeginWrite(true);
            doc.EndWrite();
            return(true);
        }
Beispiel #2
0
        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");
            }
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        protected override bool HasDocumentInternal(string name)
        {
            MongoDBDocument doc = new MongoDBDocument(name, this);

            return(doc.Exists);
        }