猫鼬文档-手动填充字段

时间:2018-11-11 14:30:53

标签: javascript mongoose

我在理解此代码可能如何工作时遇到问题。 这来自猫鼬文档: https://mongoosejs.com/docs/populate.html#setting-populated-fields

'story.author'是有意义的,但'author'却没有,这是从哪里来的?

try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/kabumbu?autoReconnect=true&useSSL=false", "root", "****");
            String q = "select player_id, sum(number_of_goals) as 'Number of Goals',school_name "
                    + "from goal_scorers g , schools s "
                    + "where g.school_id = s.school_id "
                    + "group by g.player_id "
                    + "ORDER BY number_of_goals DESC";
            PreparedStatement pstm = conn.prepareStatement(q);
            ResultSet rs = null;
            rs = pstm.executeQuery();

            jTable2.setModel(DbUtils.resultSetToTableModel(rs));

    } catch (Exception e) {
        JOptionPane.showMessageDialog(null, e);
    }

0 个答案:

没有答案