In this paper, the turnpike property is established for a nonconvex optimal control problem in discrete time. The functional is defined by the notion of the ideal convergence and can be considered as an analogue of the terminal functional defined over infinite-time horizon. The turnpike property states that every optimal solution converges to some unique optimal stationary point in the sense of ideal convergence if the ideal is invariant under translations. This kind of convergence generalizes, for example, statistical convergence and convergence with respect to logarithmic density zero sets.