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

  • Home
  • SEARCH
  • 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 8271881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:57:33+00:00 2026-06-08T06:57:33+00:00

I have found this tutorial: http://dailyjs.com/2010/12/06/node-tutorial-5/ which uses a slightly different approach from build

  • 0

I have found this tutorial: http://dailyjs.com/2010/12/06/node-tutorial-5/

which uses a slightly different approach from build model schemas then the mongoosejs.com docs.

It doesn’t creates the MongooseModel with help of mongoose.Schema:

var Some = mongoose.model('Some', new mongoose.Schema({
    property: { Type: String }
}), 'Somes');

but with something like:

var Some = mongoose.model('Some', {
    setters: {
        toLowerCase: function(string) {
            return string.toLowerCase();
        }
    }
}, 'Somes');

I personally have less issues with the second method and can read better in.
Unfortunatly there isn’t any information about this approach in the docs…

Have there some already experience with this way to define mongoose models?
Where do I find more docs about?

Regards

  • 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-06-08T06:57:36+00:00Added an answer on June 8, 2026 at 6:57 am

    Hmm I haven’t seen this notation, and it may well be completely outdated syntax looking at the post date (06 Dec 2010)

    The relevant part (although perhaps a bit sparse) in the documentation:
    http://mongoosejs.com/docs/getters-setters.html

    Note that this doesn’t mean you don’t have to define your schema anymore, setters (and getters) are there to augment the model where needed.

    hth

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

Sidebar

Related Questions

I have found this analog clock tutorial here: http://www.codeproject.com/KB/selection/AnalogClockControl.aspx Now is it possible to
I have found this tutorial online http://net.tutsplus.com/tutorials/php/creating-a-php5-framework-part-1/ I have created myself a simple sort
I have found this project on Codeplex. http://www.codeplex.com/ProjNET I need to integrate this code
I have found this piece of code in the Haskell sendfile package: http://patch-tag.com/r/mae/sendfile/snapshot/current/content/pretty/src/Network/Socket/SendFile/Linux.hsc --
I am following the tutorial http://www.bit-101.com/blog/?p=2115 . In this tutorial I found a project
I was reading this tutorial from the DNN website http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryId/2675/DotNetNuke-Skinning-101-Part-2.aspx I found the tutorial
I have been writting a keyword search script based on this tutorial: http://www.hackosis.com/2007/11/06/howto-simple-search-engine-with-php-and-mysql/ Like
I found this tutorial which uses jQuery and validation plugin to validate form input.
I found this great tutorial for extending GMarkers in v2 google maps: http://www.googlemapsbook.com/2007/01/22/extending-gmarker/ Unfortunately,
I have followed this tutorial to create the first azure application http://msdn.microsoft.com/en-us/WAZPlatformTrainingCourse_IntroToWindowsAzureLabVS2010 Because after

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.