MongoDB\BSON\Iterator::key

(mongodb >=1.16.0)

MongoDB\BSON\Iterator::key โ€” Returns the key of the current element

่ฏดๆ˜Ž

public MongoDB\BSON\Iterator::key(): string|int

ๅ‚ๆ•ฐ

ๆญคๅ‡ฝๆ•ฐๆฒกๆœ‰ๅ‚ๆ•ฐใ€‚

่ฟ”ๅ›žๅ€ผ

Returns the key of the current element. When iterating a BSON document, the key will always be a string. When iterating a BSON array, the key will be an int.

้”™่ฏฏ๏ผๅผ‚ๅธธ

ๅ‚่ง

  • Iterator::key() - ่ฟ”ๅ›žๅฝ“ๅ‰ๅ…ƒ็ด ็š„้”ฎ
๏ผ‹ๆทปๅŠ ๅค‡ๆณจ

็”จๆˆท่ดก็Œฎ็š„ๅค‡ๆณจ

ๆญค้กต้ขๅฐšๆ— ็”จๆˆท่ดก็Œฎ็š„ๅค‡ๆณจใ€‚
To Top