JavaScript node not printing full object

I'm stumped..

I tested this method with another object that contains a nested array in the console, and got the expected results

db_status_emitter.on("components_found", function (returned_item) {
    //console.log(returned_item);
    prun_item.type = returned_item.type;
    prun_item.components = returned_item.components.slice(0);
    switch (prun_item.type) {

        case "one-sided-mattress":

            prun_item.quantity = prun_item.total_panel_quantity;
            var top_panel = underscore.find(prun_item.components, function (element) {
                return element.component_category == "top-panel"
            });
            var border = underscore.find(prun_item.components, function (element) {
                return element.component_category == "border"
            });
            top_panel.quantity = border.quantity = prun_item.quantity;
            top_panel.style = "91000000";
            border.style = "81000000";
            break;

        case "two-sided-mattress":

            prun_item.quantity = prun_item.total_panel_quantity / 2;
            var top_panel = underscore.find(prun_item.components, function (element) {
                return element.component_category == "top-panel"
            });
            var bottom_panel = underscore.find(prun_item.components, function (element) {
                return element.component_category == "bottom-panel"
            });
            var border = underscore.find(prun_item.components, function (element) {
                return element.component_category == "border"
            });
            top_panel.quantity = bottom_panel.quantity = border.quantity = prun_item.quantity;
            top_panel.style = "91000000";
            bottom_panel.style = "92000000";
            border.style = "81000000";
            break;

        default:
            console.error("error with prun Schedule");
            break;
    }
    console.log(prun_item);
});

//EDIT: I should add the mongoose call here; it's in the same scope, as the .on() function... I

fex_model.findOne({_id: prun_item.model}, {components: 1, type: 1, _id: 0}, function (err, returned_item){
    if (err) db_status_emitter.emit("error", err)
    db_status_emitter.emit("components_found", returned_item);
})

why are none of the components displaying the added key value pairs I have given them? Here's a sample of the output..

{ quilter_name: 'Panel Quilter #3',
schedule_no: 55f32e4470df49a65d03cf6a,
model: '3630',
size: '66',
total_panel_quantity: 72,
type: 'two-sided-mattress',
components: 
 [ { component_category: 'top-panel', buffer_op: '120' },
   { component_category: 'bottom-panel', buffer_op: '120' },
   { component_category: 'border', buffer_op: '119' } ],
quantity: 36 }

but it should be:

{ quilter_name: 'Panel Quilter #3',
schedule_no: 55f32e4470df49a65d03cf6a,
model: '3630',
size: '66',
total_panel_quantity: 72,
type: 'two-sided-mattress',
components: 
 [ { component_category: 'top-panel', buffer_op: '120', quantity: 36, style: "91000000" },
   { component_category: 'bottom-panel', buffer_op: '120', quantity: 36, style: "92000000" },
   { component_category: 'border', buffer_op: '119', quantity: 36, style: "81000000" } ],
quantity: 36 }

but why on earth does the same process work on the console???

>underscore.extend(extended_this_object, components_wrapper);
{ foo: 'bar',
  components: 
   [ { a: 'findthis', b: '3', c: '4', d: 'new value' },
     { a: 'notthis', b: '4', c: '5' } ] }
>var foundthis2 = underscore.find(extended_this_object.components, function(element){ return element.a == 'findthis'});

>foundthis2
{ a: 'findthis', b: '3', c: '4', d: 'new value' }
>foundthis2.e = 'a newer value'
'a newer value'
>extended_this_object;
{ foo: 'bar',
  components: 
   [ { a: 'findthis',
       b: '3',
       c: '4',
       d: 'new value',
       e: 'a newer value' },
     { a: 'notthis', b: '4', c: '5' } ] }

EDIT Here's the output of the keys for a single component..I suspect it has to do with it coming from mongoose...

[ '__parentArray',
  '__parent',
  '__index',
  '$__',
  'isNew',
  'errors',
  '_doc',
  '$__original_save',
  'save',
  '_pres',
  '_posts',
  'quantity',
  'style' ]

notice that quantity and style are attributes on their own, and the logged attributes, I suspect, are somewhere in _doc.

Answer:1

I have the following link_to helper: # app/views/users/show.html.erb <div id="social"> <%= link_to "Friends", index_friends_path, id: "index_friends", remote: true %> </div> ...

I have the following link_to helper: # app/views/users/show.html.erb <div id="social"> <%= link_to "Friends", index_friends_path, id: "index_friends", remote: true %> </div> ...

I'm having troubles with REGEX trying to build one that would retrieve the first letter of a word and any other Capital letter of that word and each first letter including the any Capital letter in ...

I'm having troubles with REGEX trying to build one that would retrieve the first letter of a word and any other Capital letter of that word and each first letter including the any Capital letter in ...

So I'm developing a website for a friend of mine and have encountered an issue with the file upload field within a form. The form consists of several text inputs and the file field itself. Variables ...

So I'm developing a website for a friend of mine and have encountered an issue with the file upload field within a form. The form consists of several text inputs and the file field itself. Variables ...

  1. check file upload size in javascript
  2. check file upload in postman
  3. check file upload is empty in php
  4. check file upload in jquery
  5. check file upload extension in c#
  6. check file upload size in php
  7. check file upload php
  8. check file upload type in jquery
  9. check file upload error php
  10. check file upload size in jquery
  11. check file upload validation in jquery
  12. check file upload error in codeigniter
  13. check file upload empty javascript
  14. check file upload in javascript
  15. check file upload codeigniter
  16. check file upload laravel
  17. check file upload size c#
  18. check file upload
  19. check file upload value in jquery
  20. check file upload type javascript

in a $.each() I do a AJAX-request: $.each(all, function(i,v) { $.ajax({ url: "/mycontroller/"+encodeURIComponent(v), success: function(data){ ...

in a $.each() I do a AJAX-request: $.each(all, function(i,v) { $.ajax({ url: "/mycontroller/"+encodeURIComponent(v), success: function(data){ ...