Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 157 lines (136 sloc) 5.213 kb
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
1 using System;
2 using System.Collections.Generic;
3
a054c05 @lanwin Fix namespaces.
lanwin authored
4 namespace MongoDB
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
5 {
f89f155 @lanwin Start adding missing code comments.
lanwin authored
6 /// <summary>
7 ///
8 /// </summary>
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
9 public interface IMongoDatabase
10 {
11 /// <summary>
12 /// Gets or sets the name.
13 /// </summary>
14 /// <value>The name.</value>
15 string Name { get; }
16
17 /// <summary>
18 /// Gets the meta data.
19 /// </summary>
20 /// <value>The meta data.</value>
4a0cc9b @lanwin Fix some warnings.
lanwin authored
21 DatabaseMetadata Metadata { get; }
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
22
23 /// <summary>
24 /// Gets the javascript.
25 /// </summary>
26 /// <value>The javascript.</value>
ec9f386 @lanwin Rename DatabaseJS to DatabasJavascript because its more meaningful.
lanwin authored
27 DatabaseJavascript Javascript { get; }
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
28
29 /// <summary>
a054c05 @lanwin Fix namespaces.
lanwin authored
30 /// Gets the <see cref="MongoDB.IMongoCollection"/> with the specified name.
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
31 /// </summary>
32 /// <value></value>
7c7986a @lanwin Pass MongoConfiguration down instead of ISerializationFactory.
lanwin authored
33 IMongoCollection this[string name] { get; }
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
34
35 /// <summary>
36 /// Gets the collection names.
37 /// </summary>
38 /// <returns></returns>
39 List<String> GetCollectionNames();
40
41 /// <summary>
42 /// Gets the collection.
43 /// </summary>
44 /// <param name="name">The name.</param>
45 /// <returns></returns>
7c7986a @lanwin Pass MongoConfiguration down instead of ISerializationFactory.
lanwin authored
46 IMongoCollection GetCollection(string name);
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
47
48 /// <summary>
49 /// Gets the collection.
50 /// </summary>
51 /// <typeparam name="T"></typeparam>
52 /// <param name="name">The name.</param>
53 /// <returns></returns>
7c7986a @lanwin Pass MongoConfiguration down instead of ISerializationFactory.
lanwin authored
54 IMongoCollection<T> GetCollection<T>(string name) where T : class;
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
55
56 /// <summary>
9aaf845 @craiggwilson added overloads to IMongoDatabase to not require a collection name when ...
craiggwilson authored
57 /// Gets the collection.
58 /// </summary>
59 /// <typeparam name="T"></typeparam>
60 /// <returns></returns>
61 IMongoCollection<T> GetCollection<T>() where T : class;
62
63 /// <summary>
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
64 /// Gets the document that a reference is pointing to.
65 /// </summary>
66 /// <param name="reference">The reference.</param>
67 /// <returns></returns>
68 Document FollowReference(DBRef reference);
69
70 /// <summary>
71 /// Follows the reference.
72 /// </summary>
73 /// <typeparam name="T"></typeparam>
74 /// <param name="reference">The reference.</param>
75 /// <returns></returns>
76 T FollowReference<T>(DBRef reference) where T:class;
77
78 /// <summary>
79 /// Most operations do not have a return code in order to save the client from having to wait for results.
80 /// GetLastError can be called to retrieve the return code if clients want one.
81 /// </summary>
82 /// <returns></returns>
83 Document GetLastError();
84
85 /// <summary>
86 /// Retrieves the last error and forces the database to fsync all files before returning.
87 /// </summary>
88 /// <param name="fsync">if set to <c>true</c> [fsync].</param>
89 /// <returns></returns>
90 /// <remarks>
91 /// Server version 1.3+
92 /// </remarks>
93 Document GetLastError(bool fsync);
94
95 /// <summary>
96 /// Call after sending a bulk operation to the database.
97 /// </summary>
98 /// <returns></returns>
99 Document GetPreviousError();
100
101 /// <summary>
102 /// Gets the sister database on the same Mongo connection with the given name.
103 /// </summary>
104 /// <param name="sisterDatabaseName">Name of the sister database.</param>
105 /// <returns></returns>
dd9bfaf @samus Mongo name put back in front of Collection and Database classes to avoid...
authored
106 MongoDatabase GetSisterDatabase(string sisterDatabaseName);
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
107
108 /// <summary>
109 /// Resets last error. This is good to call before a bulk operation.
110 /// </summary>
111 void ResetError();
112
113 /// <summary>
114 /// Evals the specified javascript.
115 /// </summary>
116 /// <param name="javascript">The javascript.</param>
117 /// <returns></returns>
118 Document Eval(string javascript);
119
120 /// <summary>
121 /// Evals the specified javascript.
122 /// </summary>
123 /// <param name="javascript">The javascript.</param>
124 /// <param name="scope">The scope.</param>
125 /// <returns></returns>
126 Document Eval(string javascript, Document scope);
127
128 /// <summary>
129 /// Evals the specified code scope.
130 /// </summary>
131 /// <param name="codeScope">The code scope.</param>
132 /// <returns></returns>
133 Document Eval(CodeWScope codeScope);
134
135 /// <summary>
136 /// Sends the command.
137 /// </summary>
138 /// <param name="commandName">The command name.</param>
139 /// <returns></returns>
140 Document SendCommand(string commandName);
141
142 /// <summary>
143 /// Sends the command.
144 /// </summary>
1a8417d @craiggwilson adding and fixing typed collection tests.
craiggwilson authored
145 /// <param name="command">The command.</param>
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
146 /// <returns></returns>
147 Document SendCommand(Document command);
3f2f7cd @lanwin Pass root type to send command when using count.
lanwin authored
148
149 /// <summary>
150 /// Sends the command.
151 /// </summary>
152 /// <param name="rootType">Type of serialization root.</param>
153 /// <param name="command">The CMD.</param>
154 /// <returns></returns>
155 Document SendCommand(Type rootType, Document command);
2cee7c5 @lanwin Expose IMongoDatabase interface.
lanwin authored
156 }
157 }
Something went wrong with that request. Please try again.