Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4611740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:18:31+00:00 2026-05-22T01:18:31+00:00

I will be moving my web apps to MongoDB and I’m trying to get

  • 0

I will be moving my web apps to MongoDB and I’m trying to get a feel of “the right way” of using MongoDB C# driver in my C# code.

I’m coming from MS SQL world where I am using stored procs only when dealing with SQL Server for the following reasons:

  1. SQL code is completely separated from C# code

  2. Easy to setup SQL access security (you do it on stored proc level)

  3. SQL logic is separate from C# logic completely.

For those same reasons I have never used EF or LinqToSQL.

Following are some things that I’m trying to understand before I roll teh sleeves and start code migration:

  1. Do I need to use some kind of wrapper (I am using a home-made OR wrapper between my middle tier and low level ADO.NET calls to stored procs; the wrapper creates C# functions which internally call SP’s)

  2. Should I use MongoDB’s js server-side methods in leu of stored procs – again, to separate sql logic from c# code logic or shoudl I move all logic to C# and just do simple inserts/updates to MongoDB

  3. Any other recommendations of correctly programming my applications for use with MongoDB

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:18:31+00:00Added an answer on May 22, 2026 at 1:18 am

    The normal way CRUD operations are handled using the C# driver for MongoDB is to use the Insert, Find, Update and Remove methods of MongoCollection. There is also a Save method that calls Insert for a new document and Update for an existing document.

    The documents themselves can either be instances of BsonDocument if you wish to work at a fairly low level, or instances of your own C# classes if you wish to create classes for your domain model. The C# driver can handle mapping C# classes to and from BSON documents.

    With MongoDB you rarely use any Javascript server side, so there really is no need for anything equivalent to your SQL stored procs. You just do everything in C#.

    You might decide to create a data access layer, but it will be much thinner than anything you might have used with SQL Server because the C# driver handles the mapping between objects and BSON documents.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the near future i will get some 2 weeks for moving and improving
I am tasked with moving quite a few web apps including the databases to
Right let’s get this out the way first. Yes, I want to hide the
Moving forward with re-designing a web service architecture using WCF, our team has been
Simply moving the file to ~/.Trash/ will not work, as if the file os
Will the code below work if the clock on the server is ahead of
Will content requested over https still be cached by web browsers or do they
We are thinking on moving our Rest API Server (it is inside the web
Currently I have a section of code that needs to make about 7 web
I am looking at moving a web app from pylons to pyramid (formally repoze.bfg)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.