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 8151821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:30:58+00:00 2026-06-06T15:30:58+00:00

I have a MongoDB collection with data that was not saved through my Derby

  • 0

I have a MongoDB collection with data that was not saved through my Derby app. I want to query against that and pull it into my Derby app.

So, I figured that out and here’s the code to do it:

get '/:year', (page, model, params) ->
  query = model.query 'years', 
    where:
      year: (parseInt params.year, 10)
    limit: 1
  model.subscribe query, (err, year) ->
    if err
      console.log err

    page.render
      y: year.get(),
      year: params.year

The only problem is that the documents don’t have a derby id, so it sets the MongoDB objectid (_id) to the derby id. Here’s an example of the JSON that the model.get() returns: https://gist.github.com/0a5426d2b28a940e8803

I have no way of knowing what the objectid is before the query. I would love if the most recently returned id (currID) was in the object’s top level so I could just query that and set a model reference. I built a hack to get around it for now, but it’s not as smooth as I wish it would be. The code is below:

getId = (obj, year) ->
  for x of obj
    return obj[x].id if obj[x].year is year
  -1

Also, is there any way to update templates without destroying some templates already on the screen? Instead of doing a full page.render just doing a template.render?

Thanks

  • 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-06T15:31:00+00:00Added an answer on June 6, 2026 at 3:31 pm

    Racer queries were just updated in 0.3.11, and are described in this readme file: https://github.com/codeparty/racer/blob/master/lib/descriptor/query/README.md

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

Sidebar

Related Questions

I want to query my Mongodb collection (name: wrappers) and retrieve all documents that
Let's assume that I have a collection in mongodb, where all of its documents
I have a collection of articles in MongoDB that has the following structure: {
I have a collection of data that looks as follows: id name c1 c2
I have a mongodb that will be storing visitor data. I need to delete
I have simple MongoDB collection and I am using SLIM micro-framework to develop a
I have 10000 documents in one MongoDB collection. I'd like to update all the
I have mongodb running and using morphia. Having a Collection of BatchData Documents and
I have just started MongoDB + Java, and I am getting into queries, collections
I'm noticing that MongoDB is collapsing multiple spaces together (into one space) when saving

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.