Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ab343f89e3
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 277 lines (241 sloc) 10.624 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
using System;
using System.Collections.Generic;

namespace MongoDB
{
    /// <summary>
    /// </summary>
[Obsolete("Uses IMongoCollection<Document> instead. This class will be possible not included in future releases.")]
    public interface IMongoCollection
    {
        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>The name.</value>
        string Name { get; }

        /// <summary>
        /// Gets the name of the database.
        /// </summary>
        /// <value>The name of the database.</value>
        string DatabaseName { get; }

        /// <summary>
        /// Gets the full name.
        /// </summary>
        /// <value>The full name.</value>
        string FullName { get; }

        /// <summary>
        /// Gets the database.
        /// </summary>
        /// <value>The database.</value>
        IMongoDatabase Database { get; }

        /// <summary>
        /// Gets the meta data.
        /// </summary>
        /// <value>The meta data.</value>
        CollectionMetadata Metadata { get; }

        /// <summary>
        /// Finds the one.
        /// </summary>
        /// <param name="selector">The selector.</param>
        /// <returns></returns>
        Document FindOne(Document selector);

        /// <summary>
        /// Finds all.
        /// </summary>
        /// <returns></returns>
        ICursor FindAll();

        /// <summary>
        /// Finds the specified where.
        /// </summary>
        /// <param name = "where">The where.</param>
        /// <returns></returns>
        ICursor Find(String @where);

        /// <summary>
        /// Finds the specified selector.
        /// </summary>
        /// <param name="selector">The selector.</param>
        /// <returns></returns>
        ICursor Find(Document selector);

        /// <summary>
        /// Finds the specified spec.
        /// </summary>
        /// <param name = "spec">The spec.</param>
        /// <param name = "limit">The limit.</param>
        /// <param name = "skip">The skip.</param>
        /// <returns></returns>
        ICursor Find(Document spec, int limit, int skip);

        /// <summary>
        /// Finds the specified spec.
        /// </summary>
        /// <param name = "spec">The spec.</param>
        /// <param name = "limit">The limit.</param>
        /// <param name = "skip">The skip.</param>
        /// <param name = "fields">The fields.</param>
        /// <returns></returns>
        ICursor Find(Document spec, int limit, int skip, Document fields);

        /// <summary>
        /// Executes a query and atomically applies a modifier operation to the first document returning the original document
        /// by default.
        /// </summary>
        /// <param name="document">The document.</param>
        /// <param name="selector">The selector.</param>
        /// <returns>A <see cref="Document"/></returns>
        Document FindAndModify(Document document, Document selector);

        /// <summary>
        /// Executes a query and atomically applies a modifier operation to the first document returning the original document
        /// by default.
        /// </summary>
        /// <param name="document">The document.</param>
        /// <param name="selector">The selector.</param>
        /// <param name="sort"><see cref="Document"/> containing the names of columns to sort on with the values being the</param>
        /// <returns>A <see cref="Document"/></returns>
        /// <see cref="IndexOrder"/>
        Document FindAndModify(Document document, Document selector, Document sort);

        /// <summary>
        /// Executes a query and atomically applies a modifier operation to the first document returning the original document
        /// by default.
        /// </summary>
        /// <param name="document">The document.</param>
        /// <param name="selector">The selector.</param>
        /// <param name="returnNew">if set to <c>true</c> [return new].</param>
        /// <returns>A <see cref="Document"/></returns>
        Document FindAndModify(Document document, Document selector, bool returnNew);

        /// <summary>
        /// Executes a query and atomically applies a modifier operation to the first document returning the original document
        /// by default.
        /// </summary>
        /// <param name="document">The document.</param>
        /// <param name="selector">The selector.</param>
        /// <param name="sort"><see cref="Document"/> containing the names of columns to sort on with the values being the
        /// <see cref="IndexOrder"/></param>
        /// <param name="returnNew">if set to <c>true</c> [return new].</param>
        /// <returns>A <see cref="Document"/></returns>
        Document FindAndModify(Document document, Document selector, Document sort, bool returnNew);
        
        /// <summary>
        /// Maps the reduce.
        /// </summary>
        /// <returns></returns>
        MapReduce MapReduce();

        /// <summary>
        /// Counts this instance.
        /// </summary>
        /// <returns></returns>
        long Count();

        /// <summary>
        /// Counts the specified spec.
        /// </summary>
        /// <param name="selector">The selector.</param>
        /// <returns></returns>
        long Count(Document selector);

        /// <summary>
        /// Inserts the specified doc.
        /// </summary>
        /// <param name = "document">The document.</param>
        void Insert(Document document);

        /// <summary>
        /// Inserts the specified doc.
        /// </summary>
        /// <param name = "document">The document.</param>
        /// <param name = "safemode">if set to <c>true</c> [safemode].</param>
        void Insert(Document document, bool safemode);

        /// <summary>
        /// Inserts the specified docs.
        /// </summary>
        /// <param name = "documents">The docs.</param>
        void Insert(IEnumerable<Document> documents);

        /// <summary>
        /// Inserts the specified docs.
        /// </summary>
        /// <param name = "documents">The docs.</param>
        /// <param name = "safemode">if set to <c>true</c> [safemode].</param>
        void Insert(IEnumerable<Document> documents, bool safemode);

        /// <summary>
        /// Deletes the specified selector.
        /// </summary>
        /// <param name = "selector">The selector.</param>
[Obsolete("Use Remove instead")]
        void Delete(Document selector);

        /// <summary>
        /// Removes the specified selector.
        /// </summary>
        /// <param name="selector">The selector.</param>
        void Remove(Document selector);

        /// <summary>
        /// Deletes the specified selector.
        /// </summary>
        /// <param name = "selector">The selector.</param>
        /// <param name = "safemode">if set to <c>true</c> [safemode].</param>
[Obsolete("Use Remove instead")]
        void Delete(Document selector, bool safemode);

        /// <summary>
        /// Removes the specified selector.
        /// </summary>
        /// <param name="selector">The selector.</param>
        /// <param name="safemode">if set to <c>true</c> [safemode].</param>
        void Remove(Document selector, bool safemode);

        /// <summary>
        /// Updates the specified doc.
        /// </summary>
        /// <param name = "document">The document.</param>
[Obsolete("Use Save instead")]
        void Update(Document document);

        /// <summary>
        /// Updates the specified doc.
        /// </summary>
        /// <param name = "document">The document.</param>
        /// <param name = "selector">The selector.</param>
        void Update(Document document, Document selector);

        /// <summary>
        /// Updates the specified doc.
        /// </summary>
        /// <param name = "document">The document.</param>
        /// <param name = "selector">The selector.</param>
        /// <param name = "flags">The flags.</param>
        void Update(Document document, Document selector, UpdateFlags flags);

        /// <summary>
        /// Updates the specified doc.
        /// </summary>
        /// <param name = "document">The document.</param>
        /// <param name = "safemode">if set to <c>true</c> [safemode].</param>
[Obsolete("Use Save instead")]
        void Update(Document document, bool safemode);

        /// <summary>
        /// Updates the specified doc.
        /// </summary>
        /// <param name = "document">The document.</param>
        /// <param name = "selector">The selector.</param>
        /// <param name = "safemode">if set to <c>true</c> [safemode].</param>
        void Update(Document document, Document selector, bool safemode);

        /// <summary>
        /// Updates the specified doc.
        /// </summary>
        /// <param name = "document">The document.</param>
        /// <param name = "selector">The selector.</param>
        /// <param name = "flags">The flags.</param>
        /// <param name = "safemode">if set to <c>true</c> [safemode].</param>
        void Update(Document document, Document selector, UpdateFlags flags, bool safemode);

        /// <summary>
        /// Updates all.
        /// </summary>
        /// <param name = "document">The document.</param>
        /// <param name = "selector">The selector.</param>
        void UpdateAll(Document document, Document selector);

        /// <summary>
        /// Updates all.
        /// </summary>
        /// <param name = "document">The document.</param>
        /// <param name = "selector">The selector.</param>
        /// <param name = "safemode">if set to <c>true</c> [safemode].</param>
        void UpdateAll(Document document, Document selector, bool safemode);

        /// <summary>
        /// Saves the specified doc.
        /// </summary>
        /// <param name = "document">The document.</param>
        void Save(Document document);

        /// <summary>
        /// Saves the specified doc.
        /// </summary>
        /// <param name = "document">The document.</param>
        /// <param name = "safemode">if set to <c>true</c> [safemode].</param>
        void Save(Document document, bool safemode);
    }
}
Something went wrong with that request. Please try again.