Code Monkey home page Code Monkey logo

mongodb.web's Introduction

MongoDB.Web

A collection of ASP.NET providers (caching, membership, profiles, roles, session state, web events) for MongoDB.

NuGet Package: http://nuget.org/List/Packages/MongoDB.Web

Configuration

To use MongoDB.Web, add the providers you're interested in to your Web.config file:

<appSettings>
    <add key="MONGOHQ_URL" value="mongodb://localhost/ASPNETDB"/>    
</appSettings>

<system.web>
    <caching>
        <outputCache defaultProvider="MongoDBOutputCache">
            <providers>
                <add name="MongoDBOutputCache" type="MongoDB.Web.Providers.MongoDBOutputCacheProvider"
                    connectionString="mongodb://localhost" database="ASPNETDB" collection="OutputCache" />
            </providers>
        </outputCache>
    </caching>
    <healthMonitoring enabled="true">
        <providers>
            <add name="MongoDBWebEventProvider" type="MongoDB.Web.Providers.MongoDBWebEventProvider" bufferMode="Notification"
                connectionString="mongodb://localhost" database="ASPNETDB" collection="WebEvents" />
        </providers>
        <rules>
            <add name="LogAllEvents" eventName="All Events" provider="MongoDBWebEventProvider" />
        </rules>
    </healthMonitoring>
    <membership defaultProvider="MongoDBMembershipProvider">
        <providers>
            <clear />
            <add name="MongoDBMembershipProvider" type="MongoDB.Web.Providers.MongoDBMembershipProvider" applicationName="/"
                appSettingsConnectionStringKey="MONGOHQ_URL" collection="Users"
                enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
                maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" />
        </providers>
    </membership>
    <profile defaultProvider="MongoDBProfileProvider" enabled="true">
        <properties>
            <add name="Age" type="Int32"/>
            <add name="Country" type="string"/>
            <add name="Gender" type="string"/>
        </properties>
        <providers>
            <clear/>
            <add name="MongoDBProfileProvider" type="MongoDB.Web.Providers.MongoDBProfileProvider" applicationName="/"
                connectionString="mongodb://localhost" database="ASPNETDB" collection="Profiles" />
        </providers>
    </profile>
    <roleManager enabled="false">
        <providers>
            <clear/>
            <add name="MongoDBRoleProvider" type="MongoDB.Web.Providers.MongoDBRoleProvider" applicationName="/"
                connectionString="mongodb://localhost" database="ASPNETDB" collection="Roles" />
        </providers>
    </roleManager>
    <sessionState mode="Custom" customProvider="MongoDBSessionStateProvider">
        <providers>
            <add name="MongoDBSessionStateProvider" type="MongoDB.Web.Providers.MongoDBSessionStateProvider"
                connectionString="mongodb://localhost" database="ASPNETDB" collection="ASPState" />
        </providers>
    </sessionState>
</system.web>

mongodb.web's People

Contributors

osuritz avatar

Watchers

James Cloos avatar Titus Tlamelo Diphale avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.