ANTD + node. js + Mongoose Small Summary

Source: Internet
Author: User

Recently developed too busy, there is no time to update the blog, want to use this blog to summarize the relevant experience, in case the following can be used:

First, Antd

1.onChange of undefined problem: it is possible that the form in the page has the same name, or the parent element of the time-out form does not have a unique key set.

Wait for update ...

Second, ES6

Wait for update ...

Third, Mongoose

1. When querying, if you encounter an association relationship that queries multiple tables, you can check through the Populate property, for example:

Ser = await weblogicserver.find ({_id:_id}). Populate (' oth_id ', ' name '). Select (' name '). exec (); // oth_id for foreign key, the data to be detected is [{_id: ' xxx ', oth_id:{_id: ' xxx ', Name: ' Name '},name: ' name '}]

2. When querying many tables, it is possible to add a uniform foreign key _id to each item when the array push is available, so that it is convenient to query the owning relationship.

3. Array object check weight (via _id)

// Remove duplicate objects by ID function Uniqueobj (arr) {  = {};   = [];  Arr.foreach (function(NI) {      if(!  OBJ[NI._ID]) {          = ni;      }  });    for inch obj) {      List.push (obj[k]);  }   return list;}   

Wait for update ...

ANTD + node. js + Mongoose Small Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.