skip 跳过几条,take 查询几条数据。虽然skip和take和limit和offset很像,但是一旦有复杂连接或者子查询,limit和offset可能无法正常工作,所以需要使用skip和take防止这些问题。

    1. return await getRepository(Content)
    2. .createQueryBuilder('content')
    3. .leftJoinAndSelect('content.user','user')
    4. .skip(5) // 从第 5条开始
    5. .take(2) // 查找 2条数据
    6. .getMany()